Skip Navigation

[Resolved] Display grandchildren posts

This support ticket is created 4 years, 7 months 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Jaime 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1621353

Tell us what you are trying to do?
In a Tourism website under development I have 3 level of contents: Routes > Films > Anecdotes

The relationships are this:
Routes > Films (One to Many)
Films > Anecdotes (One to Many)

I have both of them working fine, but I can't reach to show
Routes > Anecdotes
(based on the Films included on each Route)

Is there any documentation that you are following?
Yes, I tried to follow this

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/

but I can't get it working.
I created a Content Template to show the "Anecdotes" related to the "Films" and then insert this Template into a View inside the "Route" but it's not working...
[types field='contenido-de-anecdota' item='@pelicula-anecdota.parent'][/types]

Is there a similar example that we can see?
It's pretty simple I guess. I just want to know how to display grandchildren posts, isn't it?

What is the link to your site?
It's on development but you can have a view if you need it here
hidden link

#1621763

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jaime,

It should work as intended given that the setup has been done correctly.

Would you mind allowing me to have admin access to the website so that I can see what you've setup so far.

Based on how this works you will need 2 identical parent views, one displaying the direct parent and another displaying the same direct parent but calling it's parent. This would in turn give you the grandparent.

The private fields have been enabled for your next response.

Thanks,
Shane

#1623029

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jaime,

To get this 100% clear, when I checked your relationship, what you actually want to display is the grandchildren and Not the grandparent.

So confirm that you want to display the list of "Anecdotas" on the Ruta page.

This will essentially require you to do a nested view setup. Where one view will display the children of the Ruta page and then the other will be nested in that Child view in order to display the grandchildren.

Can you confirm this so that I can provide the suitable instructions on how to achieve this.

Thanks,
Shane

#1623095

Yes Shane.
You're correct.
I want to display the grandchildren.
As you said, a list of "Anecdotas" on the "Ruta" page.

Please, give me some guidance on how to set up this nested view.
🙂

Thanks in advance Shane!
🙂

#1623129

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-05-13 at 10.36.20 AM.png
add a filter.png

Hi Jaime,

Follow the instructions below.
1. Create a view fo the Anecdotas
2. You can customize the view with how you want your posts to display.
3. On the Anecdotas view scroll to the Query Filter section and click Add A Filter. See Screenshot.
4. Select the Post Relationship filter and add it.
5. Set your relationship settings and then select "the current post in the loop". See Screenshot.
6. Create another view for Films and follow the same procedure from steps 1-4.
7. After following steps 1-4 you will now set the filter to "The Post where this view is shown".
8. Now what you will need to do is add your Anecdotas view into your Films view inside the section that is displaying the content.
9. Add your Films view to the Routes template and it should start listing out the data.

Please let me know if this was clear or if you had any difficulties following and I will be more than happy to clarify.

Thanks,
Shane

#1623957

My issue is resolved now.
Thank you!

Great Shane!
🙂