At the middle of my footer on this site, you've probably seen the list of tags. These are dynamically loaded by the tags I put in each blog post. How'd I do that? Pretty simple, actually - using the new snippet called "tagLister".
First off, download tagLister from Package Management, or get it here. Then install it into MODx Revolution.
To get started with tagLister, you'll first need a Template Variable to pull tagging data from. I've already detailed this in a prior post, but for those of you first reading this, just go ahead and create a textfield TV and name it 'tags'. Then give it access to your blog post templates (or whatever other templates you want tagging on).
Then just place tagLister wherever you want the tag list to render. It has some different properties available to it to adjust the output (documented here), but for now let's just keep it at the default state. So, your call will look like so:
This will generate a list (limited to 10) of the most popular tags used on your site. You can sort alphanumerically, as well. Those tags will also have links to your home page with '?tag=tagName' appended. So, if you're using getResourcesTag or getArchives (from Archivist) on your home page, those snippets will parse the tag REQUEST variable and automatically filter your results. Yes, that means tag-based navigation. My getResourcesTag call on my home page resource looks like this:
[[!getResourcesTag? &tpl=`blogPost` &parents=`34,35` &limit=`5` &depth=`5` &includeContent=`1` &includeTVs=`1` &showHidden=`0` &hideContainers=`1` &elementClass=`modSnippet` &element=`getResources` &pageVarKey=`page` ]] [[!+page.nav:notempty=` <div class="paging"> <ul class="pageList"> [[!+page.nav]] </ul> </div> `]]
Say you wanted the tag links from tagLister to point somewhere else, like an archives page? Simple: just use the 'target' property:
[[!tagLister? &target=`123` &limit=`5`]]
Where 123 is the ID of the Resource to link to. (Note we also limited it to 5 tags here.) Simple as that - tag-based navigation for your site!