We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30672
    • 180 Posts
    Hi !
    is there a way to add context as paramater to siblingnav?

    or another simple "previous-next" pagination plugin ?

    Thanks for your help ! [ed. note: troubadour last edited this post 12 years, 3 months ago.]
      • 4172
      • 5,888 Posts
      you can try
      https://github.com/bezumkin/pdoTools/blob/master/core/components/pdotools/elements/snippets/snippet.pdoneighbors.php

      Its included with the pdoTools - package, which doesn't matter to have it in your toolset anyway.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30672
        • 180 Posts
        thanks bruno!
        but i really don't know how to use it héhé! smiley
          • 30672
          • 180 Posts
          i installed all pdotools package and used snippet pdoNeighbors.
          it's working, but not delimited inside context. and it shows hidden ressources.

          do you know paramaters to that ?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You should be able to use a &where property; it looks like it should be a JSON-array.

            You also might be able to use all of the properties that getResources uses, such as showPublished=`0` and context=`context`, but I'm not sure of that.
              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
              • 30672
              • 180 Posts
              Thanks Sottwell but nope smiley

              tried [[!pdoNeighbors? &showUnpublished=`0`]] [[!pdoNeighbors? &showUnpublished=`1`]] [[!pdoNeighbors? &showPublished=`1`]] [[!pdoNeighbors? &showPublished=`0`]] nothing change.

              BUT :

              [[!pdoNeighbors? &context=`web` &resources=`-4`]]

              works great smiley

              since ressource 4 is my only unpublished ressource, it's ok.

              do you know how i can set context dynamically ? like id for a ressource ?


                • 30672
                • 180 Posts
                Hi!
                i didn't find how to delimitate the ressources available through pdoneighbours within the active content.

                does someone know how ?

                i tried different things like :

                [[!pdoNeighbors? &context=`[[+context_key]]`]]

                but it doesnt work.

                thanks !
                  • 4172
                  • 5,888 Posts
                  did you also try

                  [[!pdoNeighbors? &context=`[[++context_key]]`]]


                  not sure, if [[++context_key]] returns something
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 30672
                    • 180 Posts
                    thanks bruno!
                    i tried your code, but doesnt return anything... it's like pdoneighbour doesn't support context parameter ?
                      • 30672
                      • 180 Posts
                      hi bruno, and all smiley

                      i tried with this

                      [[!pdoNeighbors? &context=`[[++context_key]]`]]

                      it is working as i want in secondary context, but not primary (default) context...

                      in default context, it doesn't display anything...