We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21417
    • 486 Posts
    Hello,

    I am receiving a modx parse error when using ditto with a custom ajax content loading system.

    I previously posted in the "repurposing content" area but actually think this issue should be posted in this section.

    I am wanting to use ditto to display "gig dates and info" on the site so that old gigs can be unpublished on the relevant date.

    Linking directly (ie without ajax) to the shows demo page works as intended:
    (url removed)

    However, linking through ajax returns a modx parsing error:
    (url removed)

    The parsing error is as follows:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « `` is not numeric and may not be passed to makeUrl() »
    
    Parser timing
    MySQL: 0.0095 s (5 Requests)
    PHP: 1243332831.8380 s	 
    Total: 1243332831.8475 s


    My ditto call is as follows:
    [[Ditto? &startID=`79` &tpl=`showsRest` &tplFirst=`showsFirst` &paginate=`1` &extenders=`summary` &orderBy=`showsDate DESC`]]


    The templates look like this:
    <div class="shows">
     <h2><a href="[~[+id+]~]" title="[+longtitle+]" class="ajaxCt">[+title+]</a></h2>
     <p>[+showsDate+]</p>
     <p>[+showsInfo+]</p>
     <a href="[~[+id+]~]" title="Read the whole story" class="ajaxCt">More...</a></p>
    </p> 
    </div>
    


    I presume this parsing error has something to do with either url re-writing, php, the ajax # and/or ditto and the combination of them together but have no idea as I am a css’er not a programmer.

    Any ideas on how I can make the ditto work with the ajax system?

    I will be eternally grateful.

    Thank you kindly in advance.

      Web design Adelaide
      http://gocreate.com.au
      • 2394
      • 3 Posts
      I ran into this same error. Hopefully you found the fix.

      I believe it’s caused because the documentObject is empty and in Ditto when it’s building the URL, it references $modx->documentObject[’id’]. So I just set that in my ajax file and it seemed happy.
        • 21417
        • 486 Posts
        Hello atw26,

        Thanks for replying.

        I never found a fix actually - but I found a workaround by putting the ditto call in an iframe - that works ok but obviously adds extra markup.

        Would you mind elaborating on what you put in your ajax file - we’re using alias as page names with the hash (our urls look like domain/home.php#news).

        I am a css’er not a programmer and had someone do the ajax programming for me.

        They setup a php file to process the ajax with MOdx - it looks like the reference to $modx->documentObject[’id’] is in there rather than in the js.

        I’d love to get the ditto call working without iframes - and am very appreciative of any more help you can give.

        Thank you kindly in advance.

        Best regards,

        Nick



          Web design Adelaide
          http://gocreate.com.au
          • 2394
          • 3 Posts
          sorry, I wasn’t monitoring this thread.

          I’ve attached the ajax file (saving it as a txt instead of .php so I could attach it). Hope it helps.




            • 21417
            • 486 Posts
            thank you kindly atw26.
            will check it out.
              Web design Adelaide
              http://gocreate.com.au