We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36426
    • 197 Posts
    Hi I just wondered what the Call was in Evolution to get a url or link to the current resource. In Revolution you can use:

    <a href="[[~id]]">Link</a>


    Which works great. But I can't find any documentation of how to do this in Evolution. I've tried [~link~], [~id~] etc etc but nothing seems to work.

    Thanks very much for any help with this.
      Yorkshire UK based hosting provider: https://www.simulant.uk
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      [~[*id*]~]

      You need to have the resource variable tag nested inside the link tag. I think it's the same in Revo -
      [[~[[*id]]]]

      Otherwise you get
      [2012-07-29 14:42:54] (ERROR @ /modx224/index.php) `id` is not a valid integer and may not be passed to makeUrl()
      [ed. note: sottwell last edited this post 14 years, 2 months ago.]
        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
        • 36426
        • 197 Posts
        Hi thanks for the reply. I tried your suggestion and also: [~[*id]]

        But neither work... Any other ideas? Thanks again for the help.
          Yorkshire UK based hosting provider: https://www.simulant.uk
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You are mixing Revo and Evo tags. For Evo, the first set of tags I posted is correct. For Revo, it's the second set.

          You have to have both full tags; think about what you are saying to MODx: Take the ID of this resource,
          [*id*]

          and make a URL out of it:
          [~[*id*]~]

            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
            • 36426
            • 197 Posts
            Hi thanks, yes that works but there is one problem. It's using the alias of that page but not providing the full url/path. So as I'm trying to make it a link it's causing a problem. I can prefix it with the website address, but that will cause an issue with containers as I'm using friendly paths and urls.

            Is there a way to set the full url path of the resource?

            Thank you.
              Yorkshire UK based hosting provider: https://www.simulant.uk
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              <a href="[~[*id*]~]">Click here</a>

              will give you a working link.
                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
                • 36426
                • 197 Posts
                Hi thanks Susan, it's working well now. The reason I started this was because I'm trying include the socialitejs plugin on the website. For some reason this won't work though here: http://www.insideyork.co.uk/attractions/theyorkpass.html

                It should use the script to show how many likes etc the page has and let you click them to share, tweet etc... Any ideas why modx evolution isn't working with it? I've read all the demos etc but can't see anything wrong...
                  Yorkshire UK based hosting provider: https://www.simulant.uk
                  • 36426
                  • 197 Posts
                  Ah after commenting out Mootools.js it works...
                    Yorkshire UK based hosting provider: https://www.simulant.uk
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Ah, javascript library conflict. MODx doesn't care what javascript you use.
                      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
                      • 36426
                      • 197 Posts
                      Quote from: sottwell at Jul 30, 2012, 02:03 AM
                      Ah, javascript library conflict. MODx doesn't care what javascript you use.

                      Hi thanks for the reply - any idea how I could get the two javascript files to work together for this?
                        Yorkshire UK based hosting provider: https://www.simulant.uk