We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21502
    • 16 Posts
    Hi all,

    We are building out a site that is a repository documents that are grouped into 4 Types of documents, and then each document can have a series of Category tags applied to it (a value from a controlled vocabulary for you taxonomist types).  We want the main page for navigating to a specific document to be dynamically generated because we add new documents on a weekly basis.  Seems like this should be a piece of cake in MODx, but we’re kind of stuck.  I assume this should just be a Ditto call with a chunk to format the output, but we can’t get it to work.  Below a wireframe showing the page we’re trying to create.  Any help with the Ditto code would be most appreciated.

    Thanks,

    Jonathan

    full size image at http://thecolor27.com/wordpress/wp-content/uploads/2009/05/dynamiccategorypage.gif
      • 6507
      • 9 Posts
      Here’s the solution: http://dannyhotea.com/dhx/display-by-tv

      Snippet code to be released soon!
        • 6507
        • 9 Posts
          • 6507
          • 9 Posts
          Here’s the resulting solution: http://dannyhotea.com/dhx/blog/modx-category-and-tag-aggregation-like-wordpress

          Snippet & Notes to follow.
            • 37165
            • 89 Posts
            these links are broken. Does anyone else have a solution for this revo?
              • 3749
              • 24,544 Posts
              This might be what you want: http://rtfm.modx.com/display/ADDON/tagLister.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 37165
                • 89 Posts
                I saw that page BobRay and maybe I'm missing something but here is what I'm trying to do:

                I have my blog fully functional with taglister and to links directing links to a target resource. Lets say the user clicks on a tag called "dogs". The query works properly and the user is takes to the target resource with all the blog entries that have a tag of "dogs" However, I want it to say "dogs" at the top of the page as a heading. This is pretty standard in wordpress and I can't find anything on it here. There must be a way to do this. Do you have any ideas?
                  • 3749
                  • 24,544 Posts
                  I've never actually used TagLister, so there may be an easier way, but (and this is a wild guess) maybe you could put the category as a parameter in the URL by adding a placeholder for it in the link in your Tpl chunk.Something like this:

                  <a href=[[~[[+id]]]]? category=[[+key]]> 


                  Then on the target page, a simple snippet could pull that term for you:

                  <h3>[[!ShowCategory]]</h3>


                  <?php
                  /* ShowCategory Snippet */
                  return $_GET['category'];
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 37165
                    • 89 Posts
                    Hi BobRay, thanks for helping out, but that didn't work. It is possible that I have put the code in wrong. I am new to modx. here is my code. Any help is greatly appreciated as you are the only one who has responded to any of my posts

                    Here is my template chunk that I am using though out my blog

                    <a href="[[~[[+id]]]]? category=[[+key]]"><div class="postWrap">
                    <div class="post">
                    <span class="date">[[+publishedon:strtotime:date=`%b %d, %Y`]]</span>
                    <span id="smallThumb">[[+blogThumb:phpthumbof=`w=132px`]]</span>
                    
                        <span class="title">[[+pagetitle]]</span>
                    
                    <a href="[[~[[+id]]]]" class="readmore">Read more </a><img class="arrow" src="/assets/r_templates/images/readMorearrow.jpg" />
                    </div>
                    </div></a>


                    this is the template file that controls the resource that taglister points to:
                    [[$head]]
                    
                    <body id="subLevel">
                               	[[*backgroundImage]]
                    	<div id="pageWrapper">
                    		[[$newMenu]]
                    	<div id="contentWrapper">
                    	<div id="mainSection" style="background-image:url('[[*orangeObject]]');">
                    	  <a href="[[$siteName]][[UltimateParent]]"><h1>[[getResourceField? &id=`[[UltimateParent]]` &field=`pagetitle` ]]</h1></a>
                    	<div id="leftNavigation">[[$blogMainMenu]]
                    
                    
                    
                    
                            </div>
                    	<div id="rightSideBlog">
                    	  <h2>This is where I want the title to go
                    
                    </h2>
                    
                                    <div id="mainContent">
                                        [[*content]]
                            </div>
                    	</div>
                    	</div>
                    	  [[$r.footer]]
                    	</div>
                    	</div>
                    
                    	</body>
                    </html>
                    


                    this is the resource content area of the page that taglister points to
                    [[!getResourcesTag? &parents=`71,72,73` $tagKey=`tag` &tagRequestParam=`tag`]]
                    
                    [[!getResourcesTag? &elementClass=`modSnippet` &element=`getResources` &tpl=`blogPost` &parents=`71,72,73` &limit=`36` &includeContent=`0` &includeTVs=`32` &processTVs=`32` &tvPrefix=`` &showHidden=`0` &hideContainers=`1` &cache=`0` &pageVarKey=`page` ]]
                    
                     
                    
                    <h3>[[!showCategory]]</h3> 
                    
                    [[!+page.nav:notempty=`
                    
                    [[!+page.nav]]
                    `]]
                    
                    


                    and this is an example of the url I am current getting when clicking on the tags

                    http://newer.pointbdev.com/tag-and-archive-page/?tag=things&key=tags

                    again I want the tag clicked (in this case "things") to be dynamically inserted onto the resource page. So that when a user clicks on a tag and sees a list of all posts that have that tag, they also see a heading that shows them which tag was clicked. hope that makes sense.
                      • 3749
                      • 24,544 Posts
                      Sorry, I was wrong about the format for the $_GET arguments.

                      Try this:

                      <a href="[[~[[+id]]? category=`[[+key]]` ]] ">


                      If you need more than one, do it like this:

                      <a href="[[~[[+id]]? &category=`[[+key]]` &other=`[[+something]]` ]] ">


                      First, though I would try to check whether the "key" placeholder is set at all.


                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting