We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • To get all tags displayed in the Events and News pages, even if they aren't used in that resource, try adding in the TaggerGetTags call:
    &showUnused=`1`

      Lucy Iannotti
      Following Sea design & development
      http://www.following-sea.com
      New Bedford, MA
      • 36549
      • 572 Posts
      Hi,
      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? [ed. note: 9thwave last edited this post 7 years, 10 months ago.]
        www.9thwave.co.uk
           WEB | DESIGN | PRINT
      • Oh sorry I didn't quite understand what you meant. I'm thinking the issue is with the getResources call. Needs to be able to grab from both container pages not just the one it lives on, so you would need to set &parents to the IDs of the two containers or set it to
        &parents=`-1`
        which will use all resources as parents.

        Out of curiosity what does the call look like on the home page?
          Lucy Iannotti
          Following Sea design & development
          http://www.following-sea.com
          New Bedford, MA
          • 36549
          • 572 Posts
          Thanks again for taking the time to answer.
          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:-/

            www.9thwave.co.uk
               WEB | DESIGN | PRINT
          • I'm probably doing more harm than good here, as I am still not really sure how tagger works either. But, in trying to think through the logic... So for each container resource, you want only its child posts to show, yes? But when a tag is clicked that has posts from the OTHER container but not the one we're in, you want ... the other container to load and display the posts? Will there be tags that are used by both News and Events posts? If so where will those results display?

            Maybe the solution is to display the results in a new page...
              Lucy Iannotti
              Following Sea design & development
              http://www.following-sea.com
              New Bedford, MA
              • 25141
              • 49 Posts
              @Lucy: Have you achieved this? Because I, too, am having trouble getting this set up.

              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...
              • 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:

                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.
                • Does anyone know how to get the tag clicked on to show in the title of the page that filters resources by tags?

                  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?