Forum

Thread tagged as: Question, Blog

Active Category

what is the perch conditioning for the active link for category html template. like in the nav where you can add a class to the active link.

Timothy Rackham

Timothy Rackham 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd use PerchSystem::set_var to pass in the path of the category that you currently have active, and then in your template use perch:if to compare the category you're displaying to the one that is active.

can you give me example... not sure how to do this.

Found the page: https://docs.grabaperch.com/templates/passing-variables-into-templates/ But still not sure how to set this up....

Rachel Andrew

Rachel Andrew 394 points
Perch Support

There is an example on the page you linked to. Once you have passed in the variable use perch:if in the same way you would use it for any other id in your template.

still not sure how to implement this, it completely new to me.