Skip Navigation

[Resolved] Outputting values via a post relationship and repeatable field group

This support ticket is created 5 years, 4 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
- 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 2 replies, has 2 voices.

Last updated by josephC-5 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1343559

Hi there,

I'm making a website for an art gallery. An Artist custom post type is connected to one or more Artwork custom post types via a one-to-many relationship. Each artwork has a repeatable field group containing one or more images. The hierarchy looks like so:

Artist —> Artwork —> Image 1, Artist —> Artwork —> Image 2, ... Artist —> Artwork —> Image N

In a view that's outputting the contents of the repeatable field group (Image 1), I also want to output the title of the grandparent Artist post. Is that possible? If so, how?

Thank you!

Saul

#1343799

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As you can see with our Doc, this is how you can display the Repeating Field Group.
=> https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

In normal case - You can use the same method which is mentioned here:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/#3-create-a-content-template-that-displays-grandparent-information

So, for example - considering the following relationship (this is not involved the Repeating Field Group.):
- State
-- City
--- Employee

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

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

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

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

If you can share more information where exactly you added your view on what page/post, I will be able to check how you can display the grandparent fields.

#1343955

Minesh,

Thanks for your note. The links to the documentation were very helpful, as were the code snippets, and I was able to achieve my objective.

Thanks again!

Saul