Tell us what you are trying to do?
I want help displaying fields of great-grandparents. I cant figure out how to nest content templates in order to make it work. My post relationship structure is: chapter > section > subsection > content-block
I want to display a link to the chapter great-grandparent of the content-blocks
Is there any documentation that you are following?
This page mentions that content templates can be nested "This means that by nesting Content Templates which display parent contents, you can go as deep as you need." https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/
Is there a similar example that we can see?
hidden link
What is the link to your site?
hidden link
Okay if you're in the Content-block post, you can use a Content Template to change the context to the parent Subsection.
Content Template 1: subsection-contentblock.parent
Then nested inside Content Template 1, you can place Content Template 2.
Content Template 2: section-subsection.parent
Inside Content Template 2, you can place Content Template 3.
Content Template 3: chapter-section.parent
Inside Content Template 3, you can display information about the Chapter post.
Your relationship slugs will probably be different, but nesting them together will allow you to display information from multiple levels of hierarchy.
Could you clarify where and how I can nest one content template inside another? I have not figured that out. I think I might need an example with custom post types a > b > c > d for example. I am not clear if 'nesting' refers to the short code on the actual page or inserting code into the content templates. THANKS!
Nesting Content Templates means you create multiple Content Templates, one for each level of hierarchy. Then you place one Content Template inside another using the Content Template shortcode wpv-post-body. For example:
In the Content Blocks Content Template code editor, you will place the subsection Content Template. Here is an example of the shortcode:
[wpv-post-body item="@subsection-contentblock.parent" view_template="subsection-template"]
In the Subsection Content Template code editor, you will place the Section Content Template.
[wpv-post-body item="@section-subsection.parent" view_template="section-template"]
In the Section Content Template, you will place the Chapter Content Template.
[wpv-post-body item="@chapter-section.parent" view_template="chapter-template"]
In the Chapter Content Template, you will display whatever information from the Chapter you want to display, like the post title or custom fields.
My issue is resolved now. Thank you!