Skip Navigation

[Gelöst] This “nesting of contexts” allows us to display related posts as deep as we want

This support ticket is created vor 4 Jahre, 10 Monate. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 Antworten, has 2 Stimmen.

Last updated by Minesh vor 4 Jahre, 10 Monate.

Assisted by: Minesh.

Author
Artikel
#1273341

Hi

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

and the last sentence

This “nesting of contexts” allows us to display related posts as deep as we want

To stick with your example let's assume I'd have "continents" as a parent of countries. How would I have to «nest» this into your example?

Kind regards
Marcel

#1273423

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know first your relationship depth - do you have one to many relationships or you have nested relationship like Country -> State -> City?

#1273425

Hi

It‘s like country > state > city.

Thanks
Marcel

#1273429

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - so you need to follow the same way,

This is how you can display the parent information:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/#2-insert-post-fields-for-the-parent

This is how you can display the grandparent information:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/#4-insert-a-content-template-that-displays-grandparent-information

Considering the example:
- Country
-- State
--- -City

Create new content template and add the fields to it - the top level (country-state relationship slug):

[wpv-post-link item="@country-state.parent"]

Where:
-you need to replace the country-state with your original relaitonship slug.

Then when you add content template - add the item attribute to content template using the (state-city relationsihp slug):

[wpv-post-body item="@state-city.parent" view_template="ct-to-display-country-of-city-post"]
#1273507

Hi

Yes I got this. And it works. As I wrote I have grand granparent content.

Continent > Country > State > City

#1273509

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Great - Do you need anything else?

#1273561

Yes. The solition for my problem. I need grand grand (!) fields.

#1273567

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL and access details and what field you want to display from which relationship at where exactly?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.