Forum

Thread tagged as: Question, Runway

target a single level in multi level category using perch_categories()

I have a category with more than one level: 'category/level1/level2/level3/'

How do I return a specific level from this?

For example if I only want to return the catTitle at 'cat/level1/'

Thanks

Graham Shedden

Graham Shedden 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

In your template you can test for catDepth

Thanks Drew, perfect.

This did the trick for me.

<perch:if id="catDepth" value="2">
<perch:category id="catTitle" type="smarttext" label="Title" required="true" /><br >
</perch:if>