also, in the projects template, the field for clients-about was pulled from clients, not projects, yet it still shows the entry from projects.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
No - you can display the "Client About" on client post where it set to display with this post type using single field block or shortcode.
Client field should belongs to client post type and as you have one-to-many post relationship between Client (one - parent) and Project (many - child) we can display the parent post information on child post. That is the correct thing to do.
So I suggest first you set your correct structure for your custom fields that client related information should be display with Client post type and then we will display the related client (parent) post information on project (child) post.
I hope this makes sense.
Please check the following Doc and understand how it works:
- https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent
but at this moment the template pulls from the client post type. why is it displayig the project post type data?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I see on your project content template you added the "Fields and Text" block and added the following shortcode:
- hidden link
[types field='client-about'][/types]
- The above shortcode will display the client-about custom field value from project post.
But to display the 'client-about' field from the client post - you will have to use the following shortcode to display the related parent custom field:
[types field='client-about' item='@client-project.parent'][/types]
I added it by choosing the field from the Client post type, which was the only instance available. (see image)
the only way to change the shortcode is to edit in html mode, which I've done.
curious why it is giving me the option to add the client post type client-about but then adds it from the project post type.
In the post type settings 'where to use this field group' I think that label should be changed to 'where to duplicate this field group' or something to explain, as this isn't intuitive.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
when you try to add the field - it will offer you a popup and from that popup you should select the tab "Post Selection" and from there you can decide from what post relationship you want to display the field:
- https://toolset.com/documentation/legacy-features/views-plugin/displaying-fields-of-grandparents/#3-create-a-content-template-that-displays-grandparent-information