We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19180
    • 21 Posts
    I’m using Modx 0.9.6.3 and I setup a blog. Now I want to be able to tag all my articles(with a template variable) and have that list of tags appear on the main blog page in the side navigation. Then viewers can click on those tags and get a list of articles associated with it. I’ve been able to get this functional with the TvTagCloud snippet but I need one more thing that has stumped me.

    Within the individual article pages I want to list all the tags that are associated with that individual article and then allow the viewer to click them and once again get a full list of articles that have that tag.

    Also, to less importance, On the TvTagCloud landing page I need a title for the Tagged articles that are listed. How would I accomplish that?


    Keep in mind that I’m completely new to Modx. Just played with it for 3 days.
    Any help will be much appreciated.
      • 3707
      • 241 Posts
      To tag individual articles, you can use the tagLinks snippet.

      If you want to use the name of the selected tag as part of a title, you can use a simple snippet. TvTagCloud adds ’?tags=myTag’ the the end of the URL so you just need to get the value of the tags parameter.

      For example I use one called getParameter:
      <?php
      $parameter = isset($parameter) ? $parameter : ''; //required
      $element = isset($element) ? $element : 'p'; //optional
      $style = isset($style) ? $style : 'tagResult'; //optional
      $caption = isset($caption) ? $caption : ''; //optional
      $value = $_GET[$parameter];
      
      if ($value == ''){
      return;
      } else {
      $output = '<'.$element.' class="'.$style.'">'.$caption.' '.$value.'</'.$element.'>';
      return $output;
      }
      ?>

      Then call the getParameter snippet where you want the title to appear:
      [[getParameter? &parameter=`tags` &element=`h3` &caption=`Results for: `]]

        • 19180
        • 21 Posts
        Cool, I’ll give that a try. Thanks for the quick reply!
          • 16702 ☆ A M B ☆
          • 536 Posts
          Quote from: bob1000 at Aug 02, 2010, 09:03 AM

          To tag individual articles, you can use the tagLinks snippet.

          If you want to use the name of the selected tag as part of a title, you can use a simple snippet. TvTagCloud adds ’?tags=myTag’ the the end of the URL so you just need to get the value of the tags parameter.

          For example I use one called getParameter:
          <?php
          $parameter = isset($parameter) ? $parameter : ''; //required
          $element = isset($element) ? $element : 'p'; //optional
          $style = isset($style) ? $style : 'tagResult'; //optional
          $caption = isset($caption) ? $caption : ''; //optional
          $value = $_GET[$parameter];
          
          if ($value == ''){
          return;
          } else {
          $output = '<'.$element.' class="'.$style.'">'.$caption.' '.$value.'</'.$element.'>';
          return $output;
          }
          ?>

          Then call the getParameter snippet where you want the title to appear:
          [[getParameter? &parameter=`tags` &element=`h3` &caption=`Results for: `]]



          i have more simple tongue
          <?php
          $tags = (isset($_GET['tags'])) ? $_GET['tags'] : "";
          if(strlen($tags)>0){
          return $tags;
          }
          ?>

            palma non sine pulvere