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

    I want to create a page where I can show 6 results at a time inside of a sliding div (a la coda slider, etc).

    I have a hunch that if I could set up pagination to output into a properly formatted div instead of separate pages, this could be achieved. However, I don’t really know to modify Ditto to do this.

    Is there a way to do this? Or, any ideas on if there is another way I could achieve the desired result?

    I’m using Modx 1.0.0 / Ditto 2.1+.

    Thanks!
      • 20348
      • 8 Posts
      So I found this snippet which lets me do what I’m trying to do: http://modxcms.com/extras/package/555. The Download link there is broken, but you can get the snippet from the author’s page: http://setpro.net.pl/software/ditto-stuff.

      I can set it to output groups of six results, wrapped in a template containing the necessary markup for making the sliders work. Perfect!

      It looks like you can configure the snippet to pass through the any of the parameters for ditto (filtering, etc).

      Big thanks to alik & lokust for getting this snippet together!
        • 6538
        • 6 Posts
        Can you post some more details on how you made this work please ? smiley
          • 20348
          • 8 Posts
          Hey Daoro

          I’m using this in combination with easyslider 1.7 from http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider. This would work with other sliding plugins as well, as long as you wrapped things in the right elements/id’s/classes that that particular plugin calls for.

          This plugin uses a list in a div to create the slide effect... so my code is like this:

          <div id="slider">
          <ul>
          [!DittoFormat? &parents=`21` &depth=`1` &display=`all` &sortBy=`menuindex` &sortDir=`ASC` &group=`6` &tplGroup=`groupTpl` &tplItem=`listingTpl`!]
          </ul>
          </div>
          


          and my group template looks like this:
          <li>[+group+]</li>


          So, what it does is spit 6 results into each li, which in turn makes 6 results per slider.

          the item template can be pretty much however you need it to be, you make it the same as you would a ditto item template.

          This is working alright for me, but I would ideally like to be able to use some pagination features (i.e. "Showing 1-6 of 55 Items") and I can’t figure that one out yet. I did use a separate ditto call to at least return the total number of results, but I’ve got to imagine there’s another way that’s a bit cleaner.


          So I guess if anyone knows the answer to my original post, let me know!