2

I have a site with three broad sections of content: Humanities, Business, and Music.

Within each of these are sub-sections. Under "Humanities", for example, is Politics, History, Economics, etc. Within these are more sections as well.

What's the correct way to organize such a hierarchy?

For each index page, I want all of the posts for the entire hierarchy below it. So going to /humanities would have a feed of all of the latest entries for every section below it. Navigating to /humanities/politics/ would show just politics and its subsections.

I've looked at using categories, but want the url structure to reflect all the way down the chain. Is this possible?

1

This is Craft CMS, so there is no 'correct' way of doing it. With the routing and slug manipulation you can achieve this is many ways.

However, to me it feels like 'Categories' would be the way to go. To get your URL hierarchy that you have suggested, you'd need to set the following for the Category URI format in Settings > Categories:

{% if object.level == 1 %}{slug}{% else %}{parent.uri}/{slug}{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.