On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi guys,

    I'm looking at a way to pull the previous/next resource aswell as the page title. I've tried to use BasicNav but it doesn't pull the pagetitle, it's for a news page where you'll be able to go to the previous/next news article.

    Thanks!

    This question has been answered by wintertribe. See the first response.

      • ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
      • Quote from: lkfranklin at Jun 01, 2017, 10:10 AM
        Have a look at siblingNav
        https://docs.modx.com/extras/revo/siblingnav

        I've tried that but it doesn't let me pull the pagetitle, it just gives me arrows.
        • You should be able to stick

          [[+pagetitle]]


          into your chunk
            ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
          • Quote from: lkfranklin at Jun 01, 2017, 11:02 AM
            You should be able to stick

            [[+pagetitle]]


            into your chunk

            It doesn't seem to be working, I've tried [[+pagetitle]] as well as [[+sn.pagetitle]].

            It currently looks like this:

            <div class="col-md-12">
            [[!siblingNav]]
            [[+sn.prev]][[+sn.next]][[+sn.pagetitle]]
            </div>

            Thanks mate.
            • discuss.answer
              mtalvenheimo Reply #6, 2 years ago
              • Try this

                <nav>
                		<ul>
                			[[!siblingNav? &showHidden=`1` &nextTpl=`siblingNavNextTpl` &prevTpl=`siblingNavPrevTpl`]]
                			[[+sn.prev]][[+sn.next]]
                		</ul>
                </nav>


                Create a chunk siblingNavNextTpl called and place this inside of it:

                <li>
                	[[+_isactive:is=`1`:then=`<a href="[[~[[+id]]]]">[[+pagetitle]]</a>`:else=`Try the other way.`]]
                </li>


                Another chunk called siblingNavPrevTpl with this

                <li>
                	[[+_isactive:is=`1`:then=`<a href="[[~[[+id]]]]">[[+pagetitle]]</a>`:else=`Try the other way.`]]	
                </li>
                [ed. note: lkfranklin last edited this post 2 years ago.]
                  ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

                  The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • Thanks for the replies guys, I've ended up using PdoNeighbours and it works like a charm, thanks again!