We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36760
    • 136 Posts
    Running MODX Revolution 2.1.3-pl (traditional).

    I suspect that this question isn’t related only to Selflink, but what I’m trying to do is use a custom Tpl for Selflink to display "Next Article:" and "Previous Article:" next to the links, but to hide them when there is no next/previous article to display.

    Here’s what I have in my Tpl chunk for the next article call so far:

    <p>Next Article: <a href="">[[+pagetitle]]</a></p>


    Basically, I need to know what to put for the link. I have URLs that have a couple parents in them in some cases (i.e. http://www.example.com/parent1/parent2/page.html).

    I tried [[*alias]], but that only amends the alias name for the next page to the base URL I have defined. Which obviously won’t work if the next page is under several parents. I’m guessing this is an easy thing to do, I’m just having trouble thinking of what to search for to find it. Is it something to do with the &id definition for SelfLink?

    Thanks for the help!
      • 36760
      • 136 Posts
      Nevermind, I didn’t figure it out. It would seem that the following generates the URL of the current page, instead of the next page.

      <p>Next Article: <a href="[[~[[*id]]? scheme=`full`]]">[[+pagetitle]]</a></p>
        • 4172
        • 5,888 Posts
        This is the right syntax:

        <p>Next Article: <a href="[[~[[+id]]]]">[[+pagetitle]]</a></p>
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 36760
          • 136 Posts
          I knew it was something easier than I was making it.

          Thank you!