Skip Navigation

[Resolved] Display a Grid of Children and add Parent Title AND Grandparent Title in View

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

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 4 replies, has 2 voices.

Last updated by frankD-7 4 years ago.

Assisted by: Minesh.

Author
Posts
#2265225
Screenshot 2.png
Screenshot 1.png

Tell us what you are trying to do?
I have 3 PostTypes
- Schools
- Townships
- Regions

And two Relations
- Region - Townships (one to many)
- Township - Schools (one to many)

I would like to show a grid of Schools (Schoolname, Township, Region) in the School Archive. I am able to create a grid of Schools showing Schoolname and Township. But I can't find out how to display the Region of a school.

Is there any documentation that you are following?
I have followed courses and read forums but still am not able to accomplish it. See screenshot 1 for what I have accomplished. See screenshot 2 for what I want to accomplish.

#2265265

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

To display the grand parent field what you have to do is:
- Create a content template and add the grand parent fields you want to display to it
- Add fields and text block under your view's loop where you want to display the field
- Add the content template you created using the following shortcode:

[wpv-post-body view_template="my-ct-slug" item="@relationship-slug.parent"]

Where:
- replace relationship-slug with "Region - Townships " relationship slug
- replace my-ct-slug with your content template slug

Can you please try and let me know if that works for you. If now, please share problem URL and admin access details.

*** 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.

#2265281

Hi Minesh,... all is clear to me except one small thing. How can I find the slug of Content Templates?
"replace my-ct-slug with your content template slug"

#2265285

Minesh
Supporter

Languages: English (English )

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

As per our Docs, Either you can apply content template name or slug:
=> https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153372

[wpv-post-body view_template="My Content Template" item="@relationship-slug.parent"]
#2265381

My issue is resolved now. Thank you!