We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10487 MODX Staff
    • 1,535 Posts
    This is an auto-generated support/comment thread for PrevJumpNext.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    This snippet builds upon the PrevNext snippet and adds a drop down list to jump directly to another document of the current folder.
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
      • 17705
      • 501 Posts
      Well, I am trying to work with PrevJumpNext...
      but, what is wrong whit this?

      [[PrevJumpNext? &sortBy=`menuindex` &displayTitle=`false` &usePlaceHolder=`true` &sortHow=`ASC` &prevText=`Anterior` &nextText=`Siguiente` &displayNoPrevNext=`true` &noPrevNextText=`Es el comienzo/final`]]

      [+PJN_prev+] [+PJN_next+]


      still showing the titles on prev and next links, not Anterior & Siguiente...
      any idea?

      TIA, and sorry for the bad english smiley

      luciano
        • 17705
        • 501 Posts
        Thanks Sussan for the tip:

        Try &displayTitle=`0`, for some reason 1 and 0 seem to work better than true or false.
          • 12652
          • 228 Posts
          I’ve hardcoded the prev/next links from pagetitle to menutitle, but would be great if this was configurable from a parameter standpoint.

          Also, noticed the following code on line 159:

          $children = $etomite->getActiveChildren($parentid, $sortBy, $sortHow, $fields);


          I’m assuming that $etomite should be $modx.
            | Identity Developments delivers SEO focused web design and web presence services
            - it's not about websites, it's about your identity. |
            • 17705
            • 501 Posts
            I am using this snippet, but I need to not show unpublished documents in generated links...
            Is this too hard to achieve?
            it would be great... maybe someone can update the snippet with this new option?

            I do not have too much knowledge of php, etc... sad
              • 17705
              • 501 Posts
              oops, I mean documents with the "hide menu" option... not unpublished documents...
                • 11190
                • 109 Posts
                Is there any way to include children in PrevJumpNext? I have some complex documents arranged in an outline hierarchy, eg., 1, 2, 3, 3.1, 3.1.1, 3.1.2, 3.1.3, 3.2, 3.2.1, 3.2.2, 4, 5 . . .

                Since PrevJumpNext only looks at siblings by default, I cannot get it to include the children when the children are next or return to the Aunts and Uncles when the children are finished. For now, I’m using placeholders on each document and replacing them with custom <Prev and Next> when the flow changes levels; it’s a time consuming, arduous task for these large documents. Otherwise, PrevJumpNext does exactly what I need. Thanks - John
                  http://www.spiritualoutreach.com
                  Making Christianity intelligible to secular society
                  • 11190
                  • 109 Posts
                  Oops! this is more of a problem than I thought. I roll up all the small pages of the large document into one long document using Ditto. After spending hours doing custom <Prev and Next> tags, I realized those were showing up in the one page version whereas the placeholder output of the PrevJumpNext snippet were not. So, I’m really stuck until someone shows me how to include children in the snippet call.

                  I wouldn’t mind adapting it myself but I am completely ignorant of PHP. I see there is a call to the MODx method GetActiveChildren but there is little documentation on it. I do not know if it has an option to get descendants. I also see a GetActiveDescendants call but there is no documentation on it.

                  Sorry to be such a pain. I really do appreciate this snippet; I’m just dead in the water until I get an answer. Thanks - John
                    http://www.spiritualoutreach.com
                    Making Christianity intelligible to secular society
                    • 16551 ☆ A M B ☆
                    • 54 Posts
                    Hi there!
                    Add 4 lines in the PrevJumpNext snippet:

                    After
                    $limit = count($children);
                    add
                    $PJN_totalPlaceHolder = $limit;

                    After
                    $current=$y;
                    add
                    $PJN_currentPlaceHolder = $current;

                    Add
                    $modx->setPlaceholder(’PJN_total’,"<span class=’PJN_Menu’><span class=’PJN_Total’>".$PJN_totalPlaceHolder."</span></span>");
                    $modx->setPlaceholder(’PJN_current’,"<span class=’PJN_Menu’><span class=’PJN_Current’>".$PJN_currentPlaceHolder."</span></span>");

                    This adds the possibility to show "Showing document 4 of 20" by using "Showing document [+PJN_current+] of [+PJN_total+]" in your template.

                    Greetings
                    Lars
                      • 11190
                      • 109 Posts
                      Thank you very much, Lars. But perhaps I misunderstand. How will these additions help me navigate through the children? Thanks - John
                        http://www.spiritualoutreach.com
                        Making Christianity intelligible to secular society