On my category template pages, the {category_name} doesn’t appear. While investigating the issue, I went to Global Preferences in the Control Panel and set the “Use Category URL Titles In Links?” to “No”. When I did that the {category_name} appeared properly. This, of course, leaves me with a meaningless-to-the-user and unsightly URL with the category’s ID number.
In sifting through the User Guide, I uncovered the following:
This preference [“Use Category URL in Titles”] lets the name of each category appear in your URLs rather than the numeric indicator (e.g. “/C12/”) on pages such as your Category Archive page.
In order to use this feature, you must use the channel= parameter in the following tags, and if you specify multiple channels, they must share identical Category Groups:
{exp:channel:categories}
{exp:channel:category_heading}
{exp:channel:entries}
On my site (an online magazine), I’m pulling content from multiple channels often within the same channel entries tag. For example:
{exp:channel:entries channel="journal|primer" limit="2" status="Featured Articles|Second Leads|open"}
<section>
<ul class="featuredArticles">
<li class="{categories limit='1'}{category_css}{/categories}">
<article>
<div class="titleGroup">
<hgroup>
<h1>{display_title}</h1>
<h3>— {subtitle}</h3>
<p> </hgroup><br />
</div><br />
{image}<br />
{teaser}<br />
</article><br />
</li><br />
</ul><br />
</section><br />
{/exp:channel:entries}As far as I can tell, I am using the channel parameter in all the necessary tags and the two channels I’m using share the same Category Groups. Yet when I try to get the URL to include the category name, the {category_name} variables don’t work.
I am officially stumped. What am I missing?
-Gamiel