Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm embarrassed to admit I can't figure this one out: how do I get a URL from a nodeID in a template?
I realize I can hard-code an href to a page path, but I'd like somethng that'll survive endusers changing the page name.
- Mark
<%= umbraco.library.NiceUrl(2020) %>replace 2020 with your node id
You can also get it in a template using:
<a href="{localLink:2020}">Link Text</a>
If you wanted to get the node name as the link text, then I would suggest making a small xslt to do it for you (plus you can then have a contentPicker so there is no chance of getting the node Id wrong)
hmm - the should have some curly braces in the href attribute surrounding localLink:2020
Apologies for multiple posts, this topic covers the same thing as you are trying to achieve: http://our.umbraco.org/forum/developers/xslt/5005-NiceURL-inline-xslt
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting URL from NodeID in Template
I'm embarrassed to admit I can't figure this one out: how do I get a URL from a nodeID in a template?
I realize I can hard-code an href to a page path, but I'd like somethng that'll survive endusers changing the page name.
- Mark
You can also get it in a template using:
If you wanted to get the node name as the link text, then I would suggest making a small xslt to do it for you (plus you can then have a contentPicker so there is no chance of getting the node Id wrong)
hmm - the should have some curly braces in the href attribute surrounding localLink:2020
Apologies for multiple posts, this topic covers the same thing as you are trying to achieve: http://our.umbraco.org/forum/developers/xslt/5005-NiceURL-inline-xslt
is working on a reply...