Thanks @dashard but that's not really what I needed. I guess my explanation wasn't clear enough. Sorry about that! I'm not showing one entry on the page. I'm showing all entries filtered by any number of tags, so my URI looks like that: mysite.com/template/tag/tag01:tag02:tag03
and I'm showing all entries tagged with tag01
and tag02
and tag03
. I want to have a list of the current "page filtering" so to speak, and let the user remove some of those tags in order to broaden the filtering if they want to.
I thought the functionality might be built in, that's why I asked… But it doesn't seem like it, so I just coded it up in PHP.
In case anyone is interested, that's how it looks like:
<?php
// get the last URI segment
$tag_segment = array_pop(explode("/", urldecode($_SERVER["REQUEST_URI"])));
// put the tags in an array
$tags = explode(":", $tag_segment);
$tag_links = "";
// loop through the tags
foreach ($tags as $t) {
// rebuild the tag URI segment with all tags but WITHOUT the current one
// so when we click on a tag, it "removes" itself
$tags_others = implode(":", array_diff($tags, array($t)));
// build the tag list
$tag_links .= '<li><a href="{path=tag}/'.str_replace(" ", "+", $tags_others).'">'.$t.'</a></li>';
}
?>
<ul class="tags">
<?=$tag_links;?>
</ul>