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.
-
☆ A M B ☆
- 24,524 Posts
You need to have the resource variable tag nested inside the link tag. I think it's the same in Revo -
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.]
Hi thanks for the reply. I tried your suggestion and also: [~[*id]]
But neither work... Any other ideas? Thanks again for the help.
-
☆ 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,
and make a URL out of it:
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.
-
☆ A M B ☆
- 24,524 Posts
<a href="[~[*id*]~]">Click here</a>
will give you a working link.
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...
Ah after commenting out Mootools.js it works...
-
☆ A M B ☆
- 24,524 Posts
Ah, javascript library conflict. MODx doesn't care what javascript you use.
Quote from: sottwell at Jul 30, 2012, 02:03 AMAh, 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?