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.