Friendly URLs when inserting a pagefield into a Template
Hi Guys
When I insert an umbraco page field (of type Content Picker) directly into a template in order to link to another page within my website, the URL returned front side is /235 which is the ID of the node I wish to link to. What is the best way to return the friendly URL in this instance where we are not dealing with XSLT nor User Control and simply want the friendly URL to be in the template when published?
Thanks for the reply, do you have an example of using this library method in conjuction with the page field in a template. At the moment the page fields looks as follows in the template:
<div id="virtualtourlink"><a href="<umbraco:Item field="featureLink1Link" runat="server"></umbraco:Item>" title="Take a Virtual Tour">Click here to view our Virtual Tour</a></div>
Friendly URLs when inserting a pagefield into a Template
Hi Guys
When I insert an umbraco page field (of type Content Picker) directly into a template in order to link to another page within my website, the URL returned front side is /235 which is the ID of the node I wish to link to. What is the best way to return the friendly URL in this instance where we are not dealing with XSLT nor User Control and simply want the friendly URL to be in the template when published?
Many thanks in advance.
Kevin
Hi Kevin,
Forgive me, but if you're pulling the link into the front end, why not use the NiceUrl library method to generate the correct url?
Cheers
Richard
Thanks for the reply, do you have an example of using this library method in conjuction with the page field in a template. At the moment the page fields looks as follows in the template:
If featureLink1Link is only the node id, you could replace the current umbraco:Item control with:
Brilliant, thanks elspiko, that works perfectly and is exactly what I needed.
Cheers
is working on a reply...