Forum
Using Categories in Attribute/Navigation Templates
I seem to be having a bit of trouble with using categories in attribute and navigation templates. I can detect a category using perch:if, but I'm unable to get any information about that category (title, description etc). This is in my page attribute template:
<perch:categories id="category" label="Category" set="course" />
<perch:category id="catTitle" />
</perch:categories>
I then use perch_pages_navigation to make a sidebar which has this in it:
<perch:if exists="category">
<perch:category id="catTitle" />
test
</perch:if>
It correctly detects that a category has been set (the word "test" appears on my page) but the category title doesn't appear. Is it possible to use perch:category template tags in navigation templates?
Thanks
You need to use the
perch:categories
tag pair to output categories. So you'd have something like:Ah makes sense - working now, thanks Drew :)