Skip Navigation

[Resolved] Insert nested elements in the view

This support ticket is created 6 years, 7 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
- 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)

This topic contains 7 replies, has 2 voices.

Last updated by Fabio Proni 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#915181
4_ss.jpg
3_ss.jpg
2_ss.jpg
1_ss.jpg

Tell us what you are trying to do?
I'm trying to create a view that lets me see the elements nested one below the other

Is there any documentation that you are following?
I follow this: https://toolset.com/documentation/user-guides/repeating-fields/#Displaying%20Repeating%20Fields
and this
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

I followed the documentation by inserting in the "View" another 3 "View" with the nested elements specifying them.
But it doesn't work. I leave some screenshoot of which the first two of the "view" where the other 3 "View" are inserted, the last two of the first "view" of the nested element.

#915213

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi there

From your screenshots I take it that you want to display fields from repeating field groups (RFGs) when displaying a post (possibly a list of posts rather than an individual post).

Let's start at the end and work backwards.

RFGs are stored as posts which act as containers for the instances of fields.

So, say you have a RFG "Product list", another "Sections", and another "Characteristics", all of which are added to the Products post type, and you want to output the fields of these groups.

You will need a separate View for each one (because they each, presumably, contain different fields).

So create a View where the Content Selection is the Characteristics RFG. Add a Query Filter to identify which posts these field groups belong to (which may be the current post in the Loop or the post where this View is displayed, depending on where you insert the View).

Then in the Loop Output section insert the actual fields from this group you want to display.

Repeat this for the other two RFGs so that you now have 3 Views, one for each RFG.

You can now insert these Views somewhere where the context is the post the RFGs belong to.

So you could either insert each View into a Content Template for the Product post type to which they belong to show them on an individual product page.

Or you could create another View which lists products and insert each of the RFG Views into the Loop Output section of this View.

Note that the Content Selection for this View would only be products, you should not also include the RFGs which you have in your first screenshot.

I hope that is clear.

#915733
2_3_ss.jpg
2_2_ss.jpg
2_1_ss.jpg

Thanks now I understand better!
But when I go to insert in the "Elenco sezioni" view toolset blocks me making the introductory guide, as if I do not understand that I'm creating the view for "Elenco sezioni".
Did I do something wrong with the setting?

#915776

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

You are almost there.

If this View is displaying the repeating field group Elenco sezioni then you should be inserting the fields from within that group.

From your screenshots it looks like you are trying to insert the group itself (I think it is listed there so that it can explain you need a View and link to the documentation, but you are already doing this).

So from your second screenshot it looks like in the next line down you have fields "Nome sezione" and "Elenco Prodotti" which are part of this "Elenco sezioni" group that you can display here.

#915840
viewsezioni.jpg
line_prodotti_view.jpg

Thanks again ,
now I made 4 views each inside the other:

Caratteristiche View -> Prodotti View-> Sezioni View -> Linea Prodotti View

The latter is the one I entered in the content model for the "Products" Types,
but returns me as a message "No items found".

I do not understand the issue.
Did I incorrectly specify the "selection of content" section at the beginning of the view?
Or query filters?

#915849

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Maybe I could take a look at your site to see how you have this set up.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

Can you confirm which is the parent View where you insert the other Views to display the repeatable field groups and where that View is shown?

#916216

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi Fabio

I didn't realise your repeatable field groups are nested within in each other, though the principles are the same.

I saw that you still have problems choosing both the post type and the repeating field group in your content selection etc., so I thought it would help if I created new Views that demonstrate how to do it, and which work.

If you go to the page hidden link you will see it has a View 'TS Prodotti' that lists prodotti posts, and includes a nested View 'TS Elenco Sezione' which itself contains a nest View 'TS Elenco Prodotti'.

You can modify those as required or just look at them to see how it works and modify your existing Views.

#916229

Thank you so much, now everything is clear to me,
I missed a passage but really thank you very much!