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

    So, I love Ditto. Used it to make a very nice "intelligent" nav for a bunch of pages on our site. Cool.

    So, I am now working on a legacy project that was structured in a traditional but very awkward way and I want to use Ditto to achieve a "Next" navigation function.

    Of course, the built in pagination is fantastic, but it does not serve my purpose because of the way the page is structured. What happened is there is a container we will call "Detail Page" which also serves as the engine that compiles the page. All of the children to that container only contain a path to an image in the [+content+] area, so paging through those actual pages is not going to work. The way the prior developer put this together was to have the "Detail Page" put the page together depending on the image path in that child document. There is a variable passed in the url that is like detailpage.php?image=909302 (or whatever the child id is)

    There is then a snippet called that says, go to that child document, get the image path and fill it in on "detailpage.php"

    So... I can’t use the &show=0, &show=2, etc. method.

    I CAN however dump out all of those child document IDs with ditto. So what I need to do is dump that listing, evaluate where the current page’s ID is in that list and then assign the "Next" link to the ID that follows.

    Make sense? Anyone ever tackled something like this?

    I know I can figure this out on the solo, it’s just that I’m new to MODx and I hate doing all of thse back and forth Page >> Snippet >> Page >> Chunk >> snippet >> Page calls

    Thanks much!!!

    Rob
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Do you mean something like a prev-next menu?
        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
        • 25218
        • 7 Posts
        Sottwell,

        Exactly, but as I stated, I can’t use the built in pagination as I’m not just serving the "next" or "previous" child page.

        If there’s some built in function to grab the ID of the next child, I’m not aware of it...

        Thank you!
          • 25218
          • 7 Posts
          Sorry guys... guess I was barking up the wrong tree with this.

          I’ll make a snippet to handle this. Ditto is not the way to go for this particular application.

          Trying to figure out this getChildIds thing.


          Please delete this thread if you see fit.

          Thanks,
          Rob