Skip Navigation

[Gelöst] Nested views with repeatable fields not displaying in Content Template

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
A post type has a repeatable field group which itself contains a nested repeatable field group. When displaying the post, how to display the nested field groups?

Solution: Add a View to the post template which displays the first-level repeatable field group, which includes a Query Filter to display field groups which belong to the post where this View is shown.

In the Loop Output section insert another View, which displays the second-level field group, and which includes a Query Filter to to display field groups which belong to the current post in the Loop.

This support ticket is created vor 5 Jahre, 8 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by joshM-4 vor 5 Jahre, 8 Monate.

Assisted by: Nigel.

Author
Artikel
#1083103
Screen Shot 2018-08-14 at 11.44.49 AM.jpg
Screen Shot 2018-08-14 at 11.37.51 AM.jpg

I am trying to: display repeatable fields (that have repeatable fields) in a content template

Link to a page where the issue can be seen: hidden link

I expected to see: Results in the "The Results" section near the bottom.

Instead, I got: "No Items Found"

I'm sure it's something simple, but this is the first time I've worked with repeatable field groups. I appreciate your help and patience.

#1083575

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Josh

I looked at your site and spotted the problem.

In your second, nested, View to display the nested "Results Metrics" RFGs the Query Filter was set to show posts related to "the post where this View is shown".

That is the case study.

But this View is nested inside another View, and the Results Metrics RFGs are related to the parent Results RFGs, not the case study posts.

So the correct setting for the filter is to show posts related to "the current post in the loop".

(The implementation of RFGs uses posts to act as a container for its fields, so if you checked in the database in wp_posts you would find a post for each Results Metrics RFG, for example, with corresponding entries in wp_postmeta for the custom fields. So the Results RFGs are actually child posts of Case Studies, and Results Metrics RFGs are child posts of Results.)

#1083766

Nigel, thank you. That makes complete sense. I knew it had to be something simple I was missing.

Problem solved. Have a good one.

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