Hi there!
I need to build a nested structure of CMS items from the Divhun CMS. I am looking for ideas on structuring the Collections and the pages. I have been testing and have one picture of how to get some of what I need to do. However, it is not ideal, and I think there is a better way I haven’t figured out yet!
Here is a general example:
I want to create a list page with a list of categories.
Once a user clicks on a Category, they are taken to another list page or all the subcategories. Finally, clicking on a CMS item in the category brings you to the item as a single page/post.
The route should follow the pattern: /categories/:subcategory/:item.
And if I can figure out how to do that, then creating a Breadcrumb component for those pages should also be pretty straightforward.
Here is a specific example of how this may look like in practice:
Category → US States (FL, AL, NY …)
Subtagery → Counties (Subcategory)
2ndLevelSubcategory → Cities
Let’s take Florida, Miami-Dade County, and “North Miami Beach” as examples.
North Miami Beach page route: /fl/miami-dade/north-miami-beach
North Miami Beach page breadcrumb: FL > Miami-Date > North Miami Beach
What I have come up with so far:
Since I have not been able to figure out how to get the value of the dynamic portion of the route, the only thing I can think of is very clunky and a nightmare to maintain
Create 50 pages (one for each state) and create a collection with the information for the cities; list the State of the City as a Field and Filter the collection for that State on each of the State pages.
Of course, this solution doesn’t even consider the Counties. It’s impractical to create a Page for every County.
I know there is a better way! Please help me see the light
Thank you in advance!