Get Selected Tag on Tag block for Page List Filtering
Permalink
Hi,
I'm trying to highlight the selected tag when filtering a Page List block with a Tags block, similar to what happens with the Topic List block.
How can I retrieve what the selected tag is?
Should probably be straightforward but I'm not getting there..
Any help greatly appreciated.
Thanks
I'm trying to highlight the selected tag when filtering a Page List block with a Tags block, similar to what happens with the Topic List block.
How can I retrieve what the selected tag is?
Should probably be straightforward but I'm not getting there..
Any help greatly appreciated.
Thanks
In 5.7, you can make a custom template for the Tags block that gets the page request and extracts the tag segment from the URL.
- create the file tag_selected.php
application\blocks\tags\templates\tag_selected.php
- open tag_selected.php
- paste this code:
The "Tag Selected" custom template would be applied to the Tags block on the same page as the filtered Page List.
The current selected tag (span) would have the class "ccm-block-tags-tag-selected".