Skip Navigation

[Résolu] Nested views with repeatable fields not displaying in Content Template

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 6 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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+00:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par joshM-4 Il y a 6 années et 3 mois.

Assisté par: Nigel.

Auteur
Publications
#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: lien caché

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

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: 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.