We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18681
    • 3 Posts
    I’ve set up a bunch of keywords for all my content, using the in-build Modx keyword functionality which is really useful.

    I’ve now come to a point where I need to be able to do things like pull out a list of pages that have a certain keyword associated.

    On a lot of the Ditto tutorials about tagging it says "You can use keywords or a custom template variable for tags" then goes on to explain how to achieve this using template variables but not by keywords.

    I’ve tried guessing, using &tagData=`keywords` as a parameter instead of &tagData=`tvTags`, for example, but haven’t managed to get anything working.

    Anyone offer any clues on how I might go about this?

    Cheers! smiley
      • 18397
      • 3,250 Posts
      You need to enable the fetching of keywords with &keywords:
      http://ditto.modxcms.com/files/snippet-ditto-php.html#keywords

      Then &tagData=`keywords` should work.
        • 18681
        • 3 Posts
        Still no luck.

        Here’s what I’ve got...

        [!Ditto? &summarize=`5` &total=`20` &paginate=`1` &alwaysshow=`1` &sortBy=`createdon` &sortDir=`DESC` &trunc=`1` &truncLen=`300` &displayArchive=`1` &keywords=`1` &tagData=`keywords` &tags=`MyTagName`!]

        The tag "MyTagName" is selected in keywords of several child documents to the document that this tag is in.

        Removing the keyword stuff just renders out a list of 5 items from the section, so that works as expected, but putting the keyword stuff in produces "No Documents Found".

        What am I doing wrong?

        I might write a tutorial on this once I figure it out...

        Thanks for the help.
          • 18681
          • 3 Posts
          grin Upgrading to 2.1 from 2.0.2 made it work, so I assume this one was a bug.