Skip Navigation

[Resolved] nested view

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

Problem:

I want to display nested repeatable fields in Toolset to show a tour schedule of a recording truck with cities, each having multiple locations and schedules. I was unsure how to implement this using Toolset Views and Repeatable Field Groups.

Solution:

Enable legacy Views, then create a nested structure with two Repeatable Field Groups—Cities and within each, Locations. Use two nested Views: one for Locations and one for Cities, filtering by parent post, and embed them in the Content Template for the main "Stations" post.

Relevant Documentation:

https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

https://toolset.com/documentation/legacy-features/views-plugin/using-a-child-view-in-a-taxonomy-view-layout/

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 5 replies, has 1 voice.

Last updated by kayser 2 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2808298

Hello
I have a custom post type “stations” with several simple “custom fields” and a “repeatable group” with precise dates and locations. Reading the various articles, I saw that I needed to create a “nested view”.

I also want to put the different times and places in the city in the popup.

Do you have more precise documentation for this?
Thank you

#2808486

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support. The block editor views do not support nested method, but the legacy views do.

- Go to "Toolset > Settings > General".
- Find the "Editing experience" section.
- Check the "Show both the legacy and Blocks interface and let me choose which to use for each item I build" checkbox.
- Reload the browser page.
- Go to the newly added "Toolset > Views" menu.
- There you will be able to edit the views.

For more information:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

You can learn more about using Nested views in legacy mode here:

https://toolset.com/documentation/legacy-features/views-plugin/using-a-child-view-in-a-taxonomy-view-layout/

Thanks.

#2808732

hello
it's the same technique with a repeatable group ?

#2808791

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Repeatable groups can be shown using views. I am not sure about the context of your question.

You can use nested views if you have repeatable groups.

Thanks

#2808802

Hi
in your exemple its taxonomy
I want to show this information,
is a tour of a recording truck that will visit different venues in different towns in France.

• city 1
location 1
schedule
location2
schedule
location3
schedule
• city 2
location 1
schedule
location2
schedule
location3
schedule

#2808908

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Based on your requirements, here's how you can structure your data using Toolset's Repeatable Field Groups (RFGs) and nested Views:

You aim to display a schedule of a recording truck's tour across various cities in France. Each city has multiple locations, each with its own schedule. The desired front-end structure is:

City Name

- Location 1

- Schedule

- Location 2

- Schedule

...

Implementation Steps

Enable Legacy Views Interface:

- Navigate to Toolset → Settings → General.

- Under Editing experience, select Show both the legacy and Blocks interface and let me choose which to use for each item I build.

- Save the settings and refresh the page. You'll now see Toolset → Views in the admin menu.

Create Repeatable Field Groups (RFGs):

- Go to Toolset → Custom Fields and edit your "Stations" post type.

- Add a Repeatable Field Group named "Cities".

- Within "Cities", add a field for City Name.

- Inside "Cities", add another Repeatable Field Group named "Locations".

- Within "Locations", add fields for Location Name and Schedule.

This nesting allows each station to have multiple cities, each with multiple locations and schedules.

Create Nested Views:

View for Locations:

- Go to Toolset → Views and create a new View named "Locations View".

- Set the content selection to the "Locations" RFG.

- In the Query Filter, set it to display items where the parent is the current post in the loop.

- In the Loop Output, design the output to display the Location Name and Schedule.

View for Cities:

- Create another View named "Cities View".

- Set the content selection to the "Cities" RFG.

- In the Query Filter, set it to display items where the parent is the current post in the loop.

- In the Loop Output:

- Display the City Name.

- Insert the "Locations View" using the shortcode: [wpv-view name="locations-view"].

Integrate into Station Template:

- Edit the Content Template for the "Stations" post type.

- Insert the "Cities View" using the shortcode: [wpv-view name="cities-view"].

This setup will display, for each station, a list of cities, and under each city, its respective locations and schedules.

Thanks.

#2808950

Your implementation steps are very clear, and I'd like to thank you for that.I should be all right