We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6507
    • 9 Posts
    I’ve created a new template variable. Input type = dynamicly populated multi-select using this code:

    @EVAL return substr($modx->runSnippet(’Ditto’, array("parents"=>"11","depth"=>"1","display"=>"all","showInMenuOnly"=>"0","sortBy"=>"pagetitle","sortDir"=>"ASC", "tpl"=>"@CODE ||[+pagetitle+]==[+id+]")), 2);

    Output type = delimited list.

    The objective is to create a list of pages that link to the new page. Ex: I’m posting a new page in Topic A called "News about Topic A". I want to include a list of other pages that link to "News about Topic A". I’m lost on the Ditto syntax for this.

    How can I output the values of the delimited list as html links?
      • 33337
      • 3,975 Posts
      Try the following:

      @SELECT id,pagetitle FROM {PREFIX}site_content WHERE parent=11
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 6507
        • 9 Posts
        The thing I’m getting at is how to output the result set. Getting it works just fine. Outputting it is the hang-up.

        Any thoughts?
          • 33337
          • 3,975 Posts
          [[Ditto? &documents=`[*YOUR_TV*]` &tpl=`mytpl` &display=`all`]]


          mytpl:

          <a href="[~[+id+]~]">[+pagetitle+]</a><br/>


          Make sure you use delimiter as comma ,
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 6507
            • 9 Posts
            Did the trick! Thanks!