We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29525
    • 388 Posts
    Hi all

    I finally narrowed this down, but couldn’t find anything in the forum to help me.

    I have a ditto call that contains a filter to return information when the value of a TV matches the page title of another group of documents.

    This works perfectly in all cases except when the value of the TV, and the page title I’m trying to match, includes an &.

    The ditto filter is not finding the match. The & is part of a sponsor name so it must be in the page title and displayed in the results.

    [[Ditto? &startID=`98,99` &depth=`3` &tpl=`getvenuelink_tpl` &filter=`pagetitle,[*venue*],7`  &sortBy=`pagetitle` &sortDir=`ASC` &noResults=`xx `   ]]


    Can anyone help me make this work? This site will go live next week so I need to resolve this.

    Thank you!
      www.terrybarthdesign.com
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Most likely one of those & is actually & so of course the two won’t match.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29525
        • 388 Posts
        Hey Susan

        Yeah I looked for that. I tried it both ways using the & and using just & in each document, but no luck.

        The venue TV is dynamically populated using this:

        @EVAL return substr($modx->runSnippet('Ditto', array("parents"=>"98,99","depth"=>"1","display"=>"all","filter"=>"sponsortype,Venue,7", "sortBy"=>"pagetitle","sortDir"=>"ASC", "tpl"=>"@CODE ||[+pagetitle+]==[+pagetitle+]")), 2);


        Could this have some bearing on this? Would this affect the &? Do I have to escape the & somehow/somewhere?

        Terry
          www.terrybarthdesign.com
          • 4310
          • 2,310 Posts
          I’ve found I can’t get Ditto to filter with a non-RTE TV containing the & character.
          My only workaround was to change it to and, probably not viable in your situation.
          Maybe someone can point out where the issue might be in the Ditto code smiley
            • 29525
            • 388 Posts
            Hey Bunk58, thanks for that. I’ll stop beating my head against the wall. smiley

            I’ll talk with my client about options. They’re pretty flexible so we should be able to work something out.

            But if anyone does resolve this, let us all know.

            Thanks

            Terry

              www.terrybarthdesign.com