Forum
Using categories template tags
Hi! is there a way to display the value of a category tag without always enclosing them inside the <perch:categories></perch:categories> tags?
Here's an example of what I'd like to do, and when I do it like this I don't get the value of the "category tag".
<perch:categories>
Some html... including various <perch:category /> tags....
</perch:categories>
Instead, I am doing like this:
<perch:categories id="activities" set="activities"> <li class="mix item <perch:category id="catSlug" type="slug" />"> </perch:categories>
<a href="/activities/<perch:categories id="activities" set="activities"><perch:category id="catSlug" /></perch:categories>/<perch:content id="slug" />" class="wrap">
What end result are you trying to get to?
I'm trying to avoid the repetitive use of the <perch:categories></perch:categories> tags. What I'd like to do is to wrap my HTML markup within these tags anytime I want to use the <perch:category /> tags.
Sorry if I don't explain well.
You need the categories tags, as the contents is repeated for each category at has been applied.