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

    Hope you can help. I have a page with ditto summaries with pagination. When you click on these links, ditto appends ’?start=1’ to the URL. This breaks a javascript slideshow I have on the page, which rather than showing three images, for example, it will only show two. Appending ’?start=0’ works fine, as does the URL without the append. Anyo9ne have any ideas how to work round this?

    I have outlined the problem in full with URLs below.

    Thanks in advance, Dan.


    I have a site Im working on at http:www/jordanheritageroofing.co.uk

    On some of the pages a ditto summary is published, which you can see at http://www.jordanheritageroofing.co.uk/services.html.

    The ditto summary is in the bottom right hand box with the image of the house, and has sequence of numbers to click to see different project summaries. There is also a javascript slideshow at the top of the page that shows rotating images which it pulls from the sub pages.

    Basically if you click to view the next ’ditto summary’ (or project) it breaks the slideshow at the top of the page - it will only show 2 images instead of three. This seems to be something to do with the URL append: http://www.jordanheritageroofing.co.uk/services.html?start=1

    Is there anyway to get round this?

    Dan.


      • 16278
      • 928 Posts
      Using the &id parameter in your Ditto call should do what you need. If you set it to &id=`fred`, for instance, url?start=x will become url?fred_start=x, avoiding what sounds like a clash with a Javascript variable called start. You’ll also have to prefix placeholders such as [+previous+] with the id plus underscore: [+fred_previous+], etc.
      laugh KP
        • 6408
        • 58 Posts
        Quote from: kp52 at Dec 30, 2009, 05:57 AM

        Using the &id parameter in your Ditto call should do what you need. If you set it to &id=`fred`, for instance, url?start=x will become url?fred_start=x, avoiding what sounds like a clash with a Javascript variable called start. You’ll also have to prefix placeholders such as [+previous+] with the id plus underscore: [+fred_previous+], etc.
        laugh KP

        Thanks KP - I am using the id parameter which is set to the the doc id (53) - using a document id of ’fred’ or whatever, how would Modx know which page to call?

        Dan.
          • 6408
          • 58 Posts
          Scrub the reply above - doing some research into Ditto, I understand more about what you’re saying. However, Im thinking the answer lies more in the two ditto calls I am using:

          This is the ditto call that shows the image slideshow at the top of the page:

          <div id="slideshow">
          [!Ditto? &parents=`[*id*]` &depth='0' &removeChunk=`Comments` &tpl=`TopBanners` &paginate=`0` &paginateAlwaysShowLinks=`0`!]
          </div>


          and this is the code on the same template that produces the ditto summaries for other ’featured’ pages:

          [!Ditto? &startID=`53` &summarize=`1` &removeChunk=`Comments` &tpl=`ProjectSummaries` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1`!]


          So when the visitor clicks on the ditto summaries links in the second ditto call, the start ID of the first snippet call for the slideshow is incremented somehow.

          Dan.
            • 16278
            • 928 Posts
            Maybe the parameter names are causing some confusion here:

            - The &id parameter in the Ditto call distinguishes one Ditto instance from another on the same page. It has nothing to do with the document/resource ID. If your Ditto calls are interfering with each other, giving each an &id and prefixing their placeholders may well be what you need.

            - The &startID parameter has nothing to to do the &start parameter in the URL. &startID is an obsolete parameter telling Ditto which resource is the root of its collection of documents. The parameter in Ditto 2.1 is &parents. &startID is converted to &parents within the snippet for the sake of compatibility.

            - The &start parameter in the URL is equivalent to the &start parameter you can set in a Ditto call, indicating how many documents to skip in the results list.

            smiley KP
              • 6408
              • 58 Posts
              Thanks KP - thats cleared it up - giving the slideshow ditto call a unique ID has solved the problem!

              Thanks for your help.

              and apologies - this thread should have been in Ditto, however I wasnt sure at the time if it was the URL append, Ditto or something else.