I've been searching for a nice solution to highlight the current album - so that it behaves like Wayfinder which adds 'active' class to the current <li> item. Thanks to some posts on modx forum I've found out how to do it. It works - so I'm sharing it - in case someone needs it in the future.
I'm using Galleriffic plugin. I was basing on this forum post: ->
http://forums.modx.com/thread/73577/galleryalbums-hereclass
1) I created a new template for a gallery page with a snippet call inside
[[!Gallery? &album=`2` &plugin=`Galleriffic` &numThumbs=`3` &enableTopPager=`0` ]]
2) added
to galleriffic.chunk (core/components/gallery/elements/chunks/galleriffic.chunk.tpl)
3) modified galAlbumRowTpl
<li[[+cls:notempty=``]] class=" [[!If? &subject=`[[!GetUri]]` &operator=`==` &operand=`/galeria/[[+id]]/` &then=`active`]] " >
<a href="galeria/[[+id]]/">[[+showName:notempty=`[[+name]]`]]</a>
</li>
4) created
GetUri snippet - BobRay thank you! ->
http://forums.modx.com/thread/71166/on-getting-the-current-window-ressource-id
5) added one line to .htaccess:
# The Friendly URLs part
RewriteRule ^galeria/([^/]+)/$ galeria.html?galAlbum=$1 [L,QSA]
->
http://forums.modx.com/thread/?thread=71379&page=1
In case someone didn't want friendly urls with gallery, then galAlbumRowTpl would have to be something like this
<li[[+cls:notempty=``]] class=" [[!If? &subject=`[[!GetUri]]` &operator=`==` &operand=`/[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]` &then=`active`]] " >
<a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]">[[+showName:notempty=`[[+name]]`]]</a>
</li>
...and no changes in the .htaccess.
[ed. note: janevi last edited this post 11 years, 5 months ago.]