Use custom category listing template 'news/category':
/site/news/category
Use custom template to present “Legal Politics” 'news/category-legal-politics' entries:
/site/news/category/politics/legal
I assume that I must create a custom template called "news/category" which then dynamically picks between:
- category-listing
- articles-in-category
- special-news-category
And I am also guessing that custom URL fragments will need to come into play to achieve this. But what I do not understand how to convert the URL into the category ID:
<!-- Template Group: news Template: category -->
{exp:channel:entries channel="news" category="??{get-from-url}??"}
<h1><a href="{path='news/index'}">{title}</a></h1>
<div class="summary">{summary}</div>
{/exp:channel:entries}
Interestingly I find that the following URL works (almost) for regular category listing
/site/news/category/category/politics/legal
when using the following template:
{exp:channel:entries channel="news"}
<h1><a href="{path='news/index'}">{title}</a></h1>
<div class="summary">{summary}</div>
<ul class="categories">
{categories}
<li>{category_name}</li>
{/categories}
</ul>
{/exp:channel:entries}
If I could somehow skip the second category slug in the URL then this would be half way there!
In WordPress this would be achieved by providing a custom template "category.php" and special categories "category-legal-politics.php" or "category-42.php". What would the equivalent be for EE?