We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25018
    • 9 Posts
    I’ve got a ditto call from a page, looking up a collection of pages from a different section in modx (the results are from a different parent)

    I’m looking up values based on checkboxes which are generated based on those very pages.
    My tv name is ’cases’
    The value type is checkbox
    and the input values are:
    @SELECT pagetitle, alias FROM modx_site_content WHERE parent='2'


    This tv is available to the the these pages.

    The page that loads these pages should filter out this collection based on what pages have ’this’ value applied to them.

    So page id 2 would make a ditto call:
    [!Ditto?startID=`3`&tagDelimiter=`, ` &tpl=`caselist` &tagData=`cases` &tagMode=`onlyTags` &tags=`construction_accidents`!]


    The problem is, if the page to be loaded has only a single check checked, then it returns fine, but if there are multiple values chosen, none are returned.
    How can I work this so I can apply multiple values with a checkbox (so a page can fall into multiple categories)

    I’ve attached a screen of the modx pages for clarity.

    Thank you
    Rich

      • 4172
      • 5,888 Posts
      did you choose:
      Widget: Delimited List
      Delimiter: ,

      for your TV?

      then use &tagDelimiter=`,` without blank
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 25018
        • 9 Posts
        No but, Ooooh!
        Nice!

        That did what I needed!
        Thanks Bruno.
          • 30176
          • 99 Posts
          Hi Richtestani,

          I followed what you were doing and thanks for sharing this. One question, is that Ditto call as written to be on your Page id 2 or id 8? Since the parameter is &tags=`construction_accidents` and construction_accidents is page id 8 I would have thought this call was on Page id 8. Or am I missing something?
            "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
            -J.R.R. Tolkien from The Lord of the Rings
            • 25018
            • 9 Posts
            Hey TMcleroy,

            I actually am using the [*alias*] variable as opposed to a string.

            Here is the Ditto snippet:
            [!Ditto?startID=`3`&tagDelimiter=`,` &tpl=`caselist` &tagData=`cases` &tagMode=`onlyTags` &tags=`[*alias*]` &display=`3` &sortBy=`title`!]


            This particular set I am outputting on subpages of id: 2, because within this site I only wanted to show cases about the page they were on (which the above filters).
            Hope this helps.

            Rich
              • 30176
              • 99 Posts
              Hi Rich, Thank you for explaining....I am about 90% there. The reason I asked some of the question was on your first post the &tags=`construction_accidents` but on this last ditto the &tags=`[*alias*]` So that was some of the basis of the question.

              This is very clever. And I really appreciate your attaching the screen shots.

              If I understand correctly, this last Ditto is on Resource ID 2. Is this Ditto producing the content in this container? Children of ID 2.

              This example is very timely as I am doing something similar with textile companies that produce types of fabric in multiple area; i.e. technical, performance, apparel, home, etc. Some companies produce across areas. I have wanted to tag these thus so, however, I am still struggling with the shear number of companies and types of fabric.

              Tom
                "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
                -J.R.R. Tolkien from The Lord of the Rings