I am not sure that you can use NiceUrl with a parameter, but this should give the same that you are after using the parameter to choose the page that should be linked to.
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var internalLink = Model.MacroParameters["internalLink"];
}
@if (internalLink != null)
{
var link = @Umbraco.Content(internalLink);
<p>
<a class="btn btn-contrast" href="@link.Url">Læs mere</a>
</p>
}
Macro Content Picker use NiceUrl
Hi everybody
I can't figure out how to get "NiceUrl" working with a Macro. My code looks like this:
Is it possible to use "NiceUrl" with af Macro?
Thanks in advance!
// René
Hi René
I am not sure that you can use NiceUrl with a parameter, but this should give the same that you are after using the parameter to choose the page that should be linked to.
Hope this helps,
/Dennis
Hi Dennis
That works beautifully.
Thank you!
// René
is working on a reply...