0

At the moment, I have the following code, and it actually mostly works.

<a href="<umbraco:Item runat="server" Field="heroLinkNode" />">
    <umbraco:Item runat="server" Field="heroLinkText" />
</a>

However, it's creating a URL that looks like mydomain.com/1234 instead of mydomain.com/nice-url-of-page.

P.S. Where would I find documentation for this particular case? My Goolge-foo led me here but it wasn't too useful.

Mark
  • 3,231
  • 3
  • 32
  • 57
Geesh_SO
  • 2,156
  • 5
  • 31
  • 58
  • In umbraco 7 you could do this `umbraco.library.NiceUrl(NodeId);` is there anything similar in 6? I guess `heroLinkNode` is a custom field too so have you got anything else defined? `heroLinkUrl` for example? – Ashley Medway Sep 27 '17 at 14:46

1 Answers1

0

a few answers on the umbraco forum: https://our.umbraco.org/forum/developers/api-questions/38261-Umbraco-6-New-API-How-do-I-get-a-URL

@using Umbraco.Web
@{
    var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
}

@umbracoHelper.NiceUrl(yourId)
nologo
  • 5,918
  • 3
  • 36
  • 50