We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13137
    • 204 Posts
    I would like to use graphics or icons for the tags in the blog, but when I create them, instead of only linking to other posts with the same tag, all posts show up.

    What I have done is create a chunck with:
    <img src="assets/images/icons/grapes.png" title="grapes" border="0" />


    And then in the tags field of the blog, place {{grapes}}

    The image shows up but when clicked, brings up all posts.. undecided

    Any ideas?
      • 13137
      • 204 Posts
      Nobody can give me any clues on this one?

      Please undecided
        • 7231
        • 4,205 Posts
        We need more information about the link from the tag than from the image. I cannot understand your setup based on the info you provided.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 13137
          • 204 Posts
          OK, I’ll try again.

          For example, using the default setup from ModX, I created a few chunks:

          {{Art}}
          <img src="assets/images/icons/pallet.png" border="0" title="Art" alt="Art"/>

          and
          {{Music}}
          <img src="assets/images/icons/music.png" border="0" title="Music" alt="Music"/>


          I then went to the tags section of the blog post and along with "demo howto miniblog" I added "{{Art}} {{Music}}", with the idea that any post related to Art, I could add the Art chunk and then see a graphical tag that if clicked on, would bring up any other posts with that same graphic tag {{Art}}

          As you can see in the attachment, the icons show up fine, but when clicked, bring up all posts, not just the ones with the tag {{Art}} with the link being:
          http://localhost/modx-0.9.6.3/index.php?id=2&tags={{Art}}&start=0


          I hope this helps to explain it a bit better huh
            • 13137
            • 204 Posts
            No one can show me a bit of love here?
              • 7231
              • 4,205 Posts
              Your setup is not correct for tagging...you are looking for tags with the chunk {{Art}} in them...but art is not a tag it is a chunk with html in it...what you need to do is have a simple tag that represents the image chunk and use a snippet to display the chunk according to the selected tag. The way you have it...the tag data is the image <img src="assets/images/icons/pallet.png" border="0" title="Art" alt="Art"/> but what is stored in the database is {{Art}}...they do not match and thus the No Documents result.

              For example have a multiple choice TV with the tags you want..Art||Music. Then have a snippet to read the selected tags and output the correct image:
              switch ($tag) {
              case "Art":
                  $output =  '<img src="assets/images/icons/pallet.png" border="0" title="Art" alt="Art"/>';
                  break;
              case "Music":
                  $output =  '<img src="assets/images/icons/music.png" border="0" title="Music" alt="Music"/>';
                  break;
              }
               return $output;

              Note: this is just an example...actual code is not tested grin

              Hope this helps.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]