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

    I am new to MODX and this is my first post to the forum. It's (probably) an easy one.

    On a test site, i have a menu which is filled by [[+tags]]. That is working perfectly.
    But on every tag a number (how many times this tag is used) is appended.
    How do I get rid of this number (and the braces)?

    Thank you for reading this.

    cee

    This question has been answered by achterbahn. See the first response.

    • discuss.answer
      • 36818
      • 119 Posts
      Hi cee,

      1. create a chunk, called e.g. ArticlesTags with the following content:
      <li class="[[+cls]]"><a href="[[+url]]">[[+tag]]</a><span class="tag_count">[[+count]]</span></li>

      You can delete or hide the span with the placeholder "count".

      2. In the Articles Container in the advanced settings tab you find the options for "tagging". There in the tag list chunk you put in the name of the chunk you just created.

      Save and clear cache. You're done.

      Hope this helps.
      f.
        • 39585
        • 3 Posts
        Great stuff, thank you 8erbahn.

        It took me a while to find the 'advanced settings' tab. The most difficulties I have so far is in finding which settings are where to find.

        A follow-up question is, where is the default chunk defined. Again I haven't find it yet.

        regards,
        cee
          • 36818
          • 119 Posts
          You're welcome.

          Articles (and some other Extras) can be quite confusing.
          Sometimes they do install the default templates in the backend where you can find them under the chunk node.
          And sometimes they won't do that. They then just use the default template that is stored in the folder the extra is stored.
          E.g. Articles combines different "stand-alone" extras as Quip (for comment functionality) and tagLister (for the tagging stuff).
          Quip does install the default templates, tagLister doesn't.

          When Articles (or in this case tagLister) is installed, this process creates a folder
          core/components/tagLister/ 
          and in there you'll find all the tagLister stuff.
          In the subfolder "elements/chunks" there are the defaults chunks.

          Have a look at the tagLister-Snippet (click on it in the backend in the Elements-tree). There you'll find
          /* setup default properties */
          $tpl = $modx->getOption('tpl',$scriptProperties,'tag');

          This tells tagLister to use the default template "tag" if there is no Option in the tagLister-call that tells it to grab another chunk.
          E.g.
          [[tagLister &tpl=`myChunk`]]

          calls tagLister with the Template-Chunk "myChunk".
          [[tagLister]]
          calls the tagLister with the default template "tag".

          Working with Articles makes it even more confusing 'cause it calls tagLister for you and you won't find the call in your code.
          It just throws out the tags within the placeholder
          [[+tags]]
          .

          Hope this helps to clarify a little bit.

          f.
            • 39585
            • 3 Posts
            Thank you. Your help is very much appreciated.
            Your answer really helps me understanding the way of the [[+tags]]-call better.