<![CDATA[ Tagger Examples wanted - My Forums]]> https://forums.modx.com/thread/?thread=95632 <![CDATA[Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-517582 I am able to get the tags to show but they dont really filter anything so was hoping someone could post whats needed to make this happen.

Here's what I have right now.
[[TaggerGetTags? &showUnused=`1` &rowTpl=`tag_links_tpl`]]

tag_links_tpl
<li><a title="[[+tag]]" href="[[+uri]]">[[+tag]]</a></li>

output of these looks like this
http://mysite/page-name.html/tags/images/

Thanks Ian]]>
panfire Dec 28, 2014, 05:00 PM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-517582
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-544915
As in my example above, I was able to build the page that shows only the resources that are tagged with a certain tag, say Mobile Audio.

But for the title of the resource I want someting like:

<h1>[[++longtitle]] [[+tag]]</h1>


This thread: https://forums.modx.com/thread/?thread=91256&page=2

Says to make a snippet and I can do that but am concerned about the note of lack of security and don't know how to strip the dash between mobile-audio.

Is there a built in way of doing this I'm missing?
]]>
rx2 Sep 12, 2016, 11:04 PM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-544915
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-543905 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:

  1. Audio
  2. MP3
  3. 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:

&resources=`[[+id]]`


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.]]>
rx2 Aug 08, 2016, 10:12 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-543905
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-543901
Or at least be able to set a title on the page of filtered summaries … Thankful for any suggestions!


Quote from: lucy at May 12, 2016, 08:18 PM
Quote from: sepiariver at Apr 26, 2016, 04:16 PM


(I guess I should probably write that blog post about Tagger as well...)

I am having trouble getting Tagger working as well. And honestly - should not be this hard?! The docs are lacking. Or I am getting increasingly dense in my old age. So I hope you will write a detailed tutorial soon! I am trying to achieve a list of tag links that will reload the same page (blog home page listing of post summaries), filtered on whichever tag link is clicked obviously...
]]>
rixe Aug 08, 2016, 08:29 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-543901
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542157
Maybe the solution is to display the results in a new page...]]>
lucy Jun 03, 2016, 09:35 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542157
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542156 For the getResources call when i change the &parents from `[[*id]]` to `36,39` (which are the id's of the two containers) then every post is displayed rather than the posts from each of their respective containers.
Changing it to `-1` renders a blank page.
Doing the above to the TaggerGetTags? call does not work either.
On the home page i have the &parents set to `36,39` which is correct as i want the latest posts from both containers to be displayed.

I'm wondering if i need to add a query to the &where in the getResources call?
It must be possible but maybe i'm over complicating it:-/

]]>
9thwave Jun 03, 2016, 09:16 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542156
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542153
&parents=`-1`
which will use all resources as parents.

Out of curiosity what does the call look like on the home page?]]>
lucy Jun 03, 2016, 08:53 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542153
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542144 I don't think i explained myself very well.
I can get all tags to display on both pages. I can't get the tags to filter results when they're not being used by posts on that particular page.
I have attached a screen shot to better explain what's happening.
I can add &target=`` to the call but that of course only targets one pages tags too so no difference.
I wonder if i need to add something to the getResources &where call?

Does that make sense?]]>
9thwave Jun 03, 2016, 03:32 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=3#dis-post-542144
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=2#dis-post-542118
&showUnused=`1`

]]>
lucy Jun 02, 2016, 07:55 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=2#dis-post-542118
<![CDATA[Re: Tagger Examples wanted]]> https://forums.modx.com/thread/95632/tagger-examples-wanted?page=2#dis-post-542117 I have two container resources based on the Collections extra, one for Events and one for News. Both use the same Template and the same Tagger group.
On the home page Tagger is displaying correctly which displays all tags for both Events and News and each tag clicks through to display the correct filtered results.

On the Events and News pages all tags display in a sidebar but they only display the results for tags used in that particular container resource.
Either i want just the tags for that container resource to be displayed - or for all tags to be displayed and to click through to the correct results (both solutions for this would be helpful).

My getResources chunk for the container Template is:
[[!getResources?
  &parents=`[[*id]]`
	&tpl=`blogit.blog_row_tpl_mod`
	&includeTVs=`1`
	&processTVs=`1`
	&tvPrefix=``
	&limit=`4`
	&showHidden=`1`
	&where=`[[!TaggerGetResourcesWhere]]`
]]

And for the taglist chunk:
[[!TaggerGetTags? &rowTpl=`blogit.tag_links_tpl`]]

If i add &resources=`[[*id]]` to the above chunk then no tags appear.

What am i doing wrong?

MODX 2.5.0
Tagger 1.7.0
]]>
9thwave Jun 02, 2016, 07:27 AM https://forums.modx.com/thread/95632/tagger-examples-wanted?page=2#dis-post-542117