Forum

Thread tagged as: Question, Problem, Error

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">

Miguel Corrales

Miguel Corrales 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need the categories tags, as the contents is repeated for each category at has been applied.