We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22851
    • 805 Posts
    This is an auto-generated support/comment thread for Navigator.

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

    Brief Description
    This templatable snippet is designed to aid navigation, by providing information about a related page. Currently, this snippet handles the following relationships: next, previous (prev) and parent (up). Unlike PrevJumpNext, where next and prev correspond to siblings within the same folder, Navigator will transcend the levels of the menu system if you want too to find an adjacent document in the document tree.

    This snippet is similar to PrevJumpNext, but there are some things that PrevJumpNext does that this wont do. ’Jump’ is one of them. Ordering by something other than menuindex is also currently not supported, since it is really designed for navigating menu systems.

    The latest version can be downloaded from the repository.

    I have been using this for a while now. The latest version is pretty stable. If anyone finds any bugs, please report them here.

    Version History
    0.1 - initial release
    0.1.1 - converted to be PHP 4 compatible
    0.1.2 - fixed a bug affecting skipping of unpublished documents
    0.1.3 - fixed bug affecting the use of templates stored in files and in chunks.
      YAMS: Yet Another Multilingual Solution for MODx
      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
      • 22851
      • 805 Posts
      This is in reply to a question posted on this thread about how to get Navigator to create prev and next links for a container and its children.

      Moondawgy. If you had, for example, the following prev and next chunks:
      PrevChunk:
      <a class="navlink" rel="[+nav.rel+]" type="[+contentType+]" href="[(site_url)][~[+id+]~]">Prev: [+pagetitle+]</a>

      NextChunk:
      <a class="navlink" rel="[+nav.rel+]" type="[+contentType+]" href="[(site_url)][~[+id+]~]">Next: [+pagetitle+]</a>

      and you had the following document hierarchy


      • document id 1
      • document id 2
        [list]
        [li]child document id 3
      • child document id 4
      • ...
      [/li]
      [li]document id 5[/li]
      [/list]

      and you wanted to create previous and next links for document 2 and its children, and documents 2 and 5 are published (they might be dummy documents), then could place the following snippet calls in your container template

      [[Navigator? &rel=`prev` &template=`PrevChunk` &stopIds=`1`]]
      [[Navigator? &rel=`next` &template=`NextChunk` &stopIds=`5`]]
      


      Alternatively, if documents 2 and 5 are not published, then you could tell the snippet where to stop by using the following snippet calls.

      [[Navigator? &rel=`prev` &template=`PrevChunk` &unpublishedAction=`stop`]]
      [[Navigator? &rel=`next` &template=`NextChunk` &unpublishedAction=`stop`]]
      


      By default the snippet transcends levels and only displays documents which are set to show in the menu. You can use &notInMenuAction=`link` to force the snippet to display info for documents set to not show in the menu.

      Hope this works for you. Let me know how it goes.
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 36527
        • 120 Posts
        Hi PMS,

        Again - thanks so much - but no joy - still does show any links in the parent container document.

        Given your example then if I set the actual stop and start ids of the prior and following containers - nothing shows on the parent still - ID6.

        Navigator, PrevNextJump and DocLink do not display anything in the parent container.

        Hopefully the screengrab of the tree might help you visualise my issue.

          • 22851
          • 805 Posts
          Well, that is weird. Are you sure document 6 uses the same template as the child documents and that it is published? Another possibility is that is has been cached. If it’s a cacheable document, try clearing the cache.
            YAMS: Yet Another Multilingual Solution for MODx
            YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
            Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
            • 36527
            • 120 Posts
            Yup very sure smiley

            Parent and all children of Portfolio have the same template - call is as follows:

            [[Navigator? &rel=`prev` &template=`PrevChunk` &stopIds=`4`]]
            [[Navigator? &rel=`next` &template=`NextChunk` &stopIds=`5`]]

            Just to confirm that when I manually goto the first child document - all works as it should from then on in and stops at ID 5 as per the call. But just does not display on the parent.

            Mad isn’t it!
              • 22851
              • 805 Posts
              Sorry, I am clutching at straws a bit. I do have the snippet working like you want on a site which, unfortunately, is not online yet, so I can’t show you.

              Things to try:

              Please can you check that documents 4, 5 and 6 have different menuindexes? If they have the same menuindex, that could be confusing the snippet.

              Another thing to try is using uncacheable snippet calls [! ... !].

              Another thing to try is specifying that you want the snippet to transcend levels explicitly using &transcend=`1`

              By the way, can you get any snippet to work on that page? For example, the snippet TestMe, where TestMe contains
              <?php
              return 'Just testing!';
              ?>


                YAMS: Yet Another Multilingual Solution for MODx
                YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                • 36527
                • 120 Posts
                PMS,

                That is a big CHECK on all those points listed....

                I tried a weblink to the first child - and it works just fine - it is this container issue that seems to be affecting me not just your snippet but DocLink and NextPrevJump....

                I just swapped snippets to NextPrevJump using the weblink route to first child - it now works as expected - but not on the parent (when I call the URL of the parent directly in the browser to test it as it uses still the same template and calls as the children).

                This is very strange...
                  • 22851
                  • 805 Posts
                  So, just to check I understand fully...
                  Using Navigator,

                  • from document 17, you see a prev link to 10 and a next link to 25.
                  • from document 10, you see a prev link to 6 and a next link to 17.
                  • from document 6, you don’t see anything.
                  Is that right?
                    YAMS: Yet Another Multilingual Solution for MODx
                    YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                    Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                    • 36527
                    • 120 Posts
                    Quote from: PMS at Apr 10, 2009, 01:02 PM

                    So, just to check I understand fully...
                    Using Navigator,

                    • from document 17, you see a prev link to 10 and a next link to 25.
                    • from document 10, you see a prev link to 6 and a next link to 17.
                    • from document 6, you don’t see anything.
                    Is that right?

                    From 17 see both

                    From 10 no prev link to 6

                    From 6 - nothing

                    It is like 6 does not exist sad

                    Oh and the environment:

                    MODx version 0.9.6.3
                    Version codename rev 4565
                    Access permissions Enabled
                    Database server localhost
                    Database Version: 5.0.67
                    Database Charset latin1
                    Database Collation Charset latin1_swedish_ci
                    Table prefix modx
                      • 22851
                      • 805 Posts
                      Given that doc 6 is published and set to show in menu, then I am completely stumped. My last suggestion would be to try removing the stopIds snippet parameter, but if that doesn’t work then I don’t know what else to suggest. Sorry!

                      If you wanted to create me a restricted manager account and send me the details as a private message, then I’d be happy to log in and take a look in case I spot something you haven’t.

                        YAMS: Yet Another Multilingual Solution for MODx
                        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.