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
can anyone tell me how i would render a url in a hyperlink for a page chosen via the content picker datatype?
Hi Mark!
The content picker should just return the ID of the page you have picked, so you should just be able to do this:
var page = Umbraco.Content(CurrentPage.linkPicker);
Where 'linkPicker' is the name of your Content Picker property.
And then you can access the Url like this:
<a href="@page.Url">@page.Name</a>
Hope this helps.
Hi Mark,
@Umbraco.NiceUrl(CurrentPage.pickerPropertyAlias)
Jeavon
Oh hey, that's a much simpler solution! :)
it sure is!
thanks a lot
You're welcome!
If you only need the URL thats the way to do it. If you also need the Name then of course Elliot's suggestion is the answer as you have the whole object there.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
URL for content picker datatype
can anyone tell me how i would render a url in a hyperlink for a page chosen via the content picker datatype?
Hi Mark!
The content picker should just return the ID of the page you have picked, so you should just be able to do this:
Where 'linkPicker' is the name of your Content Picker property.
And then you can access the Url like this:
Hope this helps.
Hi Mark,
Jeavon
Oh hey, that's a much simpler solution! :)
it sure is!
thanks a lot
You're welcome!
If you only need the URL thats the way to do it. If you also need the Name then of course Elliot's suggestion is the answer as you have the whole object there.
is working on a reply...