Skip Navigation

[Resolved] Displaying grandparent

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nik 7 years ago.

Assisted by: Luo Yang.

Author
Posts
#590115

Nik

Hi

I have 1:manys of

developer - package - module

This all looks good in each of their edit screens where they see their parents and/or children.

When I come to display a module am looking for

Grandparent - Parent- LAYOUT TEMPLATE

So in my layout template for module I succesfully retrieve the Package name with: [types field='package-name' id='$package'][/types]

To get the grandparent I believe I need to use a content template cell, where I attempt to retrieve the developer with: [types field='developer-first-names' id='$developer'][/types] [types field='developer-surname' id='$developer'][/types]

But what I get out (debug on) is only: Calling functions are frontend_render_cell_content, render_view_template

What am I doing wrong please?

#590121

Dear Nik,

I assume we are talking about this case, in a single "Child" post, display the custom fields of it's grandparent post.

If it is, please follow our document to setup the content template:
https://toolset.com/documentation/user-guides/displaying-fields-grandparents/
We explain how to achieve this using Content Templates and reach as deep into the post hierarchy as we wish.

#590127

Nik

Hi

That is the document I was following, but it hasn’t worked.

#590128

It should be a independent content template, not a content template cell as you mentioned in the post:
https://toolset.com/forums/topic/displaying-grandparent/#post-590115
In the content template display the custom fields of grandparent post

Then in the single child post, display above content template, with id attribute, for example:
[wpv-post-body id="$parent-post-slug" view_template="above-content-template-slug"]

If you still need assistance for it, please try these:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL and layout URL, I need to test and debug it in my localhost, thanks

#590137

Nik

Sorry, my bad, I missed the id:

<p>Developer: [wpv-post-body id='$package' view_template="fetch-developer-for-module-layout"]</p>

Thanks for your help!