We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13740
    • 86 Posts
    I need to show quotes on pages using Ditto.
    Each quote will be categorized, and can be in multiple categories (I was planning no creating a multi-select TV for this)
    The pages that show the quotes will also have a TV that designates which quote categories to show on the page.
    Can someone help me with how to accomplish this?
      • 31214
      • 3 Posts
      I’m currently doing something like that on a site I’m making.

      I’m using the following code in the category view template:

      [!Ditto? &startID=`212` &tagData=`categories` &tagDelimiter=`,` &tagMode=`onlyTags` &tags=[*categories*] !]


      &tagData=`categories` : the TV that holds the quote’s categories, separated by commas
      &tagMode=`onlyTags` : so that it matches only things that match all the categories
      &tags=[*categories*] : the categories that we are looking to return. In this case held within a TV of the category view

      Hope that points you in the right direction.
        • 13740
        • 86 Posts
        Awesome - thank you!

        Just thinking of them as "tags" instead of "categories" completely changes how you look at it!
          • 13740
          • 86 Posts
          One other question:

          I’m pre-setting the tags in the TV using a multiselect, but when I edit the TV, it throws off the selection in each document - can anyone suggest a better way (I’d rather not leave it up to the client to type a comma-separated list)

          Thanks!
            • 33337
            • 3,975 Posts
            Just a suggestion:

            Use latest Ditto, and use &parents instead of &startID.
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link