We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37165
    • 89 Posts
    I have set up a blog according to this tutorial: http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

    The question I have is about taglister. Right now when a user clicks on a tag they are redirected to a list of all the blog posts that have the same tag( this is good) but I also want it to display the name of that tag in the <h2> space of my template. here is the code to my template:

    
    [[$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> </h2>
    
                    <div id="mainContent">
                        [[*content]]
            </div>
    	</div>
    	</div>
    	  [[$r.footer]]
    	</div>
    	</div>
    
    	<script type="text/javascript">
            var DISModifyPost = $(function() {
                DIS.config.attachments_max_per_post = 5;
                DIS.DISModifyPost.init({
                    attachments: 1
                });
            });</script>
    <script type="text/javascript">
            var DISModifyPost = $(function() {
                DIS.config.attachments_max_per_post = 5;
                DIS.DISModifyPost.init({
                    attachments: 1
                });
            });</script>
    <script type="text/javascript">
            var DISModifyPost = $(function() {
                DIS.config.attachments_max_per_post = 5;
                DIS.DISModifyPost.init({
                    attachments: 1
                });
            });</script>
    </body>
    </html>
    


    this is the taglister call I am using:

     [[*tags:notempty=`
    <span class="tags">Tags: [[!tolinks? &items=`[[*tags]]` &key=`tag` &target=`81`]]</span>
        `]]


    [ed. note: rrswans last edited this post 15 years ago.]
      • 37165
      • 89 Posts
      got the answer from Charless here is is if anyone wants it

      harless Reply #2, 13 min ago

      Un-mark As SolutionReply
      You could create a very simple snippet that would simply output the tag value when the key/value pair for tags is present in the query string.

      Vary basic snippet (ex snippet name: dyntagtitle):
      //-- Get all request string key/value pairs
      $s = $_REQUEST;
       
       
       
      if($s['key'] == 'tags'){
        return $s['tag'];
      } else {
       return false;
      }
      


      Then on the page template simply put the snippet call where you want it to be displayed:

      [[!dyntagtitle]]
      



      cheers