I had trouble too, but I did get it to work (using MODX 2.5.1).
I am using pdoResources rather than getResources (which answers wemyssweb's question about using pdoResources instead of getResources) though the examples should apply to both.
I'll begin with my Tagger settings.
Group: Tags
Alias: blog-tags
Field Type: Tag field
Remove unused tags: Yes
Allow new tags from field: Yes
Allow blank: unchecked
Allow type: checked
Show autotag: checked
Hide Input: unchecked
Tag limit: 0
Show for Templates: 10
Note: 10 is the id of my blog article template.
I've created 3 tags to experiment with:
- Audio
- MP3
- Video
I have applied the following tags to the following Blog articles:
Article A: Audio, MP3, Video
Article B: Audio, Video
Article C: MP3
Next, my Blog Table of Contents, which lists each article title, along with author, date, summary, and the tags associated with the article, which are clickable to a page that show only the articles using that tag.
I've created a chunk: [[$getBlogArticles]]
It has the following code:
<div id="pdopage">
<div class="rows">
[[!pdoPage?
&parents=`[[++blog_toc_id]]`
&depth=`0`
&limit=`3`
&ajaxMode=`default`
&tpl=`blogListingTPL`
]]
</div>
[[!+page.nav]]
</div>
A standard manner of listing blog articles. I'm using pdoPage here to use the built in ajax pagination. The context setting [[++blog_toc_id]] identifies the blog toc resource for the context, in this case the id is 11.
The most important thing here is the template.
Template: blogListingTPL
Code:
<h2>[[+longtitle]]</h2>
<p>by: [[+createdby:userinfo=`fullname`]] on [[+publishedon:date=`%b %d, %Y`]]</p>
<p>[[+introtext]]<br><a href="[[~[[+id]]]]">Read More</a></p>
<p>Tags: [[!TaggerGetTags? &resources=`[[+id]]` &target=`[[++blog_tag_page_id]]` &rowTpl=`tagListingTPL`]]</p>
The key relevant line is the TaggerGetTags call that says to get the tags from the current resource:
Identifies the target resource, in this case we're using a context setting again but it could be a direct resource id, which in our case is 18:
&target=`[[++blog_tag_page_id]]`
And of course the template used to display the tags:
&rowTpl=`tagListingTPL`]]
The template contains the following code:
<a href="[[+uri]]">[[+tag]]</a>
The key is the pdoResources or getResources call on target page, the page that will list all the articles associated with the clicked on tag. On that page I've created a chunk called: [[$showTaggedArticles]]. It contains the following code:
[[!pdoResources?
&parents=`[[++blog_toc_id]]`
&where=`[[!TaggerGetResourcesWhere]]`
&tpl=`taggedResourcesTPL`
]]
Like others, I couldn't get any results showing up here until I put in
&parents=`[[++blog_toc_id]]`. Namely, I had to tell pdoResources (and therefore most likely getResources if you're using that) where to get the tags from so this line is what did it for me:
&parents=`[[++blog_toc_id]]`
Without this, I got no results, so I believe this is the key.
Again, the context setting just identifies the ID of my Blog TOC page for the context which in this case is 11.
The template for listing the blog entries, taggedResourcesTPL is:
<p><a href="[[~[[+id]]]]">[[+longtitle]]</a></p>
Finally, on the Blog article page itself I have a chunk called: [[$showArticle]].
It contains the following code:
<h1>[[*longtitle]]</h1>
<p>by: [[*createdby:userinfo=`fullname`]] on [[*publishedon:strtotime:date=`%b %d, %Y`]]</p>
<h2>Tags</h2>
<p>[[!TaggerGetTags? &resources=`[[*id]]` &target=`[[++blog_tag_page_id]]` &rowTpl=`tagListingTPL`]]</p>
[[*content]]
Note: It uses the same TaggerGetTags call I used the template for listing the blog articles on the blog TOC page. That way users can click a tag in the article itself as well to see other pages that use the same tag.