Forum

Thread tagged as: Question, Problem, Gallery

Album nav list - highlighting active item

Using the gallery app. I have an image list of albums using 'a_list_image.html' on a page in a left column. On the right column I have a text list of albums using 'a_album.html'.

In the right column, how can I highlight the active album in the list?

Thanks

Chris James

Chris James 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

How do you know which is the active album? Is there something on the URL at that point?

Yes it seems so. So when Im in an album the url for album 'paintings' shows:

https://mywebsite.com/album.php?s=album-paintings

...although the client will name the album whatever they wish.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so you could pass that into the template using

PerchSystem::set_var('current_album', perch_get('s'));

Then in your template:

<perch:if id="albumSlug" match="eq" value="{current_album}">
    this is the current album
</perch:if>

Ok I'll try that but I'm not clear where I'm putting

PerchSystem::set_var('current_album', perch_get('s'));

??

Drew McLellan

Drew McLellan 2638 points
Perch Support

In your page before the Gallery function.