We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6705
    • 79 Posts
    I have a (currently, relatively little-used) news section on an intranet site, which is going to see more use soon. Previously, we were using the "Keywords" field to list the tag(s) relevant to each news article, so that, in addition to the "all news" page, we could have additional separate news pages which would, using Ditto, only display articles matching the relevant keyword. However, at some point during one of the MODx upgrades (we're currently running MODx Evo 1.0.6, Ditto 2.1.0), the Keywords tab has been marked as deprecated, and is no longer visible in the article editor.

    We would like to retain the functionality whereby we can add tags/categories to new news articles (and have Ditto be able to filter on these tags). What would be the recommended way to do this now?

    (Am I right in thinking that Ditto is no longer being developed? I realise that things move on constantly, and if there happens to be an alternative solution that might be suitable (and that is reasonably easy to learn!) I wouldn't be averse to using that instead, if necessary.)

    Thanks for any advice.
      Please don't PM me unless it's absolutely essential: if a technical question is worth asking, it's worth asking in public, so that others can share their experience, and so that all can learn from the answers.
      • 16278
      • 928 Posts
      Your alternatives are to enable the Keywords tab again via Tools > Configuration > Interface & Features or to use a Template Variable instead (a Text, options or list type). The TV is the normal option anyway, while the Keywords tab is really oriented towards the Meta tag in the HEAD section. See Pogwatch for a few tips.

      Ditto development ceased some years ago, but Ditto is very mature and well proven in use by many. many people, so it's unlikely to stop working all of a suddent. More significant is that Evo development has ceased!

      :) KP
        • 6705
        • 79 Posts
        Hi kp52, thanks for your helpful reply.

        I realised that Evo development was slowing down (understandably), but I hadn't realised that it had completely ceased. Unfortunately, we don't really have the time resources available at present to move our site to Revo, and it may not be a simple job to do so as we have written a lot of our own snippets to interface with our own databases.

        I looked up the documentation on Template Variables, and tried to set up a TV of type "Check Box" (because I want contributors to be able to choose one or more specified categories, rather than enter free-form text which is likely to lead to multiple misspellings, arbitrary categories, etc).

        Will this data type work with Ditto? I ask, because my test article summary page doesn't quite seem to be working properly, the tags are displayed squashed together as onelongword [sic] (ie, in the case that I had tried to select the tags "one" "long" and "word"), despite having thought that I had written my Ditto code correctly?

        Here's the code on the article summary page:

        [!Ditto? &parents=`963` &paginate=`1` &display=`10`
        &depth=`2` &filter=`isfolder,1,2`
        &tpl=`news_headline_full_tpl` &extenders=`summary`
        &dateFormat=`%e %B %Y, %H:%M.` 
        &tagData=`NewsTags` &tagDelimiter=`,` &tagDisplayDelimiter=`, ` !]
        
        <p>
        Showing [+start+] - [+stop+] of [+total+] articles.
        <br />
        [+previous+] [+pages+] [+next+]
        </p>
        



        Here's my article summary template:

        <!-- Link to the article using its title -->
        <h2 class="blogtitle">
        <a href="[~[+id+]~]" title="[+title+]">[+title+]</a>
        </h2>
        
        <p class="newsmeta">
        <strong>[+date+]</strong>
        | <em>[+author+]</em>
        | Tags: [+tagLinks+]
        </p>
        
        <div class="newslink">
        <p>
        <a href="[~[+id+]~]" title="[+title+]">[+summary+]</a>
        <span class="readmore"><a href="[~[+id+]~]" title="[+title+]">[Read more »]</a></span>
        </p>
        </div><!-- /newslink -->
        



        I must be missing something in my Ditto call, but I can't work out what?!


          Please don't PM me unless it's absolutely essential: if a technical question is worth asking, it's worth asking in public, so that others can share their experience, and so that all can learn from the answers.
          • 16278
          • 928 Posts
          The problem is most likely in your checkbox TV. In order to have the multiple checked items output as a comma-separated list, you need to select "Delimited List" as the Widget, and put in a comma as the Delimiter. Then the TV output will match up with &tagDelimiter=`,`.

          TV Widgets control how their output is formatted.
          :) KP
            • 6705
            • 79 Posts
            Brilliant, thanks! That's done the trick!

            I wasn't very sure what Widgets are actually for (or how they work), and so I must just have glossed over that section..

            And especial thanks for the useful picture, too! smiley
              Please don't PM me unless it's absolutely essential: if a technical question is worth asking, it's worth asking in public, so that others can share their experience, and so that all can learn from the answers.