We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28626
    • 87 Posts
    Well I have a site of over 1000 pages and I though it was very clever of me to use a template that would add previous and next buttons automatically so I didn’t have to manually add those.

    Now it turns out that was a pretty stupid id(ea).

    I used
    return $modx->documentIdentifier+1;


    for next and you could figure out what I used for the previous one.

    This works great as long as all your documents are in the same order as the document tree in the manager, but as soon as you move documents around or god forbid add new ones it’s completely messed up. Now I don’t feel so clever anymore, it only lasted a couple of days now I feel humble again wink . Anyway I figure if the document tree knows the order of documents than it should technically be possible to make those next and previous link use some other id to figure out what’s previous and what is next.

    I hope some smart modx fellow here could help me out.