We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm working on a blog that has a list of tags in the right column and a list of categories in the same column. Using tagLister and getResourcesTag for a list of tags works great. The filtered tag results are displayed on the target page as expected.

    I created a second tagLister call on the same page identical to the first except I added a parameter &tagKey= `category` for the filter rather than the default of `tags` and I changed the id of the target page.

    All entries are displayed in the results. They are not filtered by the category tv. I can display the values of the category tv in the results so I know they are available.

    I have searched high and low for a resolution. I could use some help.

    Here's what I'm using.

    Revo 2.2.0-pl2

    The tags are listed correctly in the sidebar with this:
    [[!tagLister? &tv=`tags` &target=`27` &limit=`99` &sortBy=`tag`]]


    The categories are listed correctly in the sidebar with this:
     [[!tagLister? &tv=`category` &tagVar=`category` &target=`34`  &limit=`99` &sortBy=`tag`]]


    The filtered tag results are displayed with this on the target page:
    <h1>Results for Entries Tagged With "[[!getTagRequested]]"</h1>
    <p>[[!getResourcesTag? &elementClass=`modSnippet` &element=`getResources` &tpl=`tagsummaryitemtpl` &parents=`16` &limit=`99` &includeContent=`1` &includeTVs=`1` &showHidden=`0` &hideContainers=`1` &cache=`0` &pageVarKey=`page` ]] [[!+page.nav:notempty=`</p>
    <div class="paging">
    <ul class="pageList">[[!+page.nav]]</ul>
    </div>
    <p>`]]</p>


    The category results page displays all entries and the title outputs this. Results for Entries Tagged With "". To ensure there were values in the category tv, I add it to the tpl and they are displayed along with the title, date, content, etc. with each result.

    Here's the call on the target page for categories.

    <h1>Results for Entries Tagged With "[[!getTagRequested]]"</h1>
    <p>[[!getResourcesTag? &elementClass=`modSnippet` &element=`getResources` &tagKey=`category`  &tpl=`tagsummaryitemtpl` &parents=`16` &limit=`99` &includeContent=`1` &includeTVs=`1` &showHidden=`0` &hideContainers=`1` &cache=`0` &pageVarKey=`page`  ]] [[!+page.nav:notempty=`</p>
    <div class="paging">
    <ul class="pageList">[[!+page.nav]]</ul>
    </div>
    <p>`]]</p>


    The URL does show the selected category on the results page:
    http://domain.com/index.php?id=34&category=success+stories&key=category


    I'm using Auto-Tag on the TVs.
    Rich Text is unchecked for the content field on the target pages.

    Any suggestions
      • 36551
      • 416 Posts
      Anyone?
        • 37131
        • 111 Posts
        This is URL generated by tagLister that don't work or it is 'manual' link that works ?
          ---
          Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding
          • 36551
          • 416 Posts
          If I understand your question correctly. It appears to me the URL is properly generated by taglister, but the search results on the page are not filtered.
            • 37131
            • 111 Posts
            I've switched my dictionary to english but grammar left native, sorry smiley

            I was asking about the link you have provided:

            <a href="http://domain.com/index.php?id=34&category=success+stories&key=category%3C/pre%3E%3C/div%3E" target="_blank" rel="nofollow">http://domain.com/index.php?id=34&category=success+stories&key=category</a>

            I'm asking about it because you've said:
            The category results page displays all entries and the title outputs this. Results for Entries Tagged With "".
            I understood this as parameters are not passed correctly in URL generated by tagLister. That's why I'm suspecting tagLister call as problem.
            If this link is generated by tagLister (and it looks right indeed), then problem lies in GetResourcesTag's call and it may be missing &tagRequestParam=`category` parameter.

            [ed. note: khyrlik last edited this post 12 years, 2 months ago.]
              ---
              Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding
              • 36551
              • 416 Posts

              Fantastic! That works. Since I didn't have this parameter on the results page for tags, can I assume it's not needed since tag is the default?

              Finally for the heading at the top of the page, I'm have:
              <h1>Results for Entries Tagged With "[[!getTagRequested]]"</h1>


              While this works on the tag results page, it doesn't work on the category results page. Any ideas on this?
                • 37131
                • 111 Posts
                I've learned that MODx docs are obsolete quite often and you have to took into files to get current list of Properties (and they almost always have default values).

                I don't know what getTagRequested is, maybe you can show the source of this ?
                  ---
                  Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding
                  • 36551
                  • 416 Posts
                  Well I've sorted this out.

                  This snippet is from this post: http://forums.modx.com/thread/39571/taglister-and-related-posts-for-revo

                  GetTagRequested is a simple snippet
                  echo $_GET["tag"];


                  I just created another called GetCategoryRequested that looks like this.
                  echo $_GET["category"];


                  Problem solved. Your comments sent me in the right direction.

                  Thank you.