Skip Navigation

[Resolved] Nested views with repeatable fields not displaying in Content Template

This thread is resolved. Here is a description of the problem and solution.

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

This topic contains 2 replies, has 2 voices.

Last updated by joshM-4 3 years, 3 months ago.

Assigned support staff: Nigel.

Author
Posts
#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: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00: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.