We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30912
    • 463 Posts
    Ive developed a requirement to use a TV of some kind for the document ids in the ditto call - basically to make it as easy as possible for an end user to just add the id without seeing the whole call

    something along the lines of

    [!Ditto? &documents=`[*TVDocuments*]` &tpl=`template` !]


    basically we want the enduser to just have to write 24,25,29 int he box and it will pull therough the right documents

    when i did the above it just came up with a parse error - to me it should work but Ditto probbaly doesnt work that way?

    anyone done anything similar?
      • 16183
      • 1,390 Posts
      Am no ditto expert but I think to reference a TV within ditto you need

      [+template_variable_field_name+] 


      cheers/k
        • 16278
        • 928 Posts
        Works for me. I just made a simple TV (type=Text, nothing more) called "tvdocs", put a list of IDs in the TV in a document with the Ditto call
        [!Ditto? &documents=`[*tvdocs*]` &debug=`1`!]
        and out they come. I thought it might be the back-ticks around your TV parameter, but it doesn’t seem to make any difference whether they are there or not. What is the parse error you are getting?  huh KP

        (Later: re backticks - the call worked without them on my local Windows installation, but required on Linux server)
          • 30912
          • 463 Posts
          Hi Guys,

          thanks for the input, Kp - seems that it was a backtick that was causing the issue, i put a ’ instead of `

          thanks for the syntax though
            • 7155
            • 160 Posts
            I have a similar requirement but I am getting a "No documents found error". I did search and found this thread wink. I hope I’m "helpable"

            Ditto Call:
            <ul>
            [!Ditto? &documents=`[*tvRelated*]` &tpl=`tplRelatedItem` !]
            </ul>

            Chunk:tplRelatedItem
            <li><a href="[~[+id+]~]" title="[+link+]">[+pagetitle+]</a></li>

            TV:
            tvRelated (Input Type: text) nothing else

            Environment:
            Windows XP
            MODx 0.9.6.2
            Ditto 2.1.0
            WAMP 2.0 (MySQL 5.0.51b, Apache 2.2.8, PHP 5.2.6)

            thanks

            tino
              • 7155
              • 160 Posts
              solved, I had mispelt the template name.
                • 30912
                • 463 Posts
                Works like a charm (forgot to reply lol!)

                and yeah i often make typos