We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42141
    • 73 Posts
    I want to display a list of articles with a certain tag. Is that possible and how can that be achieved? In the RTFM I can't find something on that.
      • 37099
      • 338 Posts
      Yes that's possible.

      I use tags as Categories on this page http://onsitenow.co.uk/journal/


      You'll need the extra taglister installed and something like this in your template:

      	<ul>
      	   [[parseTagList? 
      	        &list=`[[tagLister? 
                                      &parents=`121`
                                      &tv=`articlestags` 
                                      &target=`121` 
                                      &tpl=`tagListTpl`
                                      &limit=`50`
      		        ]]`
      	   ]]
      	</ul>
      


      And tagListTpl looks like this:

      <li class="[[+cls]]"><a href="[[+url]]">[[+tag]]</a> ([[+count]])</li>


      And parseTagList is:

      <?php
      $output = str_replace('?tag=', 'tags/', $list);
      $output = str_replace('&key=articlestags', '', $output);
      
      
      return $output;
      
      
      [ed. note: thingstodo last edited this post 9 years, 7 months ago.]