Check out this post for a nice example. Try this <a href='<umbraco:Item runat="server" field="MoreInfoLink" xslt="umbraco.library:NiceUrl({0})" />' >More info</a>
The value of MoreInfoLink gets replaced with {0}. so that should do the trick.
The {localLink:id} syntax from the richtext editor seems to work in templates on its own. Not sure if this would cause a performace hit, but I quite like the succinct nature, and you can then use the umbraco:Item properties to make it recursive, or have a backup property
NiceURL inline xslt
Hi,
I am amost embarassed to ask as I know the answer is going to be simple, however can someone please tell me what is wrong with the line below.
<a href='<umbraco:Item runat="server" xslt="umbraco.library:NiceUrl($currentPage/data[@alias=MoreInfoLink])" />' >More info</a>
Thanks
Aaron
This is basic XML - you can't use elements inside attributes - you need to use what's called an Attribute Value Template (~ curly braces):
/Chriztian :-)
Hi Aaron,
Check out this post for a nice example. Try this <a href='<umbraco:Item runat="server" field="MoreInfoLink" xslt="umbraco.library:NiceUrl({0})" />' >More info</a>
The value of MoreInfoLink gets replaced with {0}. so that should do the trick.
Hope it helps you,
Richard
Oh - my bad - I was assuming this was happening inside an XSLT file.
/Chriztian
Thanks for all your replies! Richards code did the trick.
Just another option - you can do this without needing the inline xslt:
The {localLink:id} syntax from the richtext editor seems to work in templates on its own. Not sure if this would cause a performace hit, but I quite like the succinct nature, and you can then use the umbraco:Item properties to make it recursive, or have a backup property
Josh Townson, thanks a lot ... very nice and simple solution ...
is working on a reply...