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
Im trying to populate a link in my template from a Content Picker DataType using Razor.
<a id="slide_1" href="#">Our Operations</a>
So just the href (#) and the anchor (Our Operations).
How do I go about doing this from an embedded Macro in a template?
Would something like this work for you?
@{
var node = @Library.NodeById(Model.aliasForContentPickerType);
<a href="@node.Url">@node.Name</a>
}
Yup, perfect!! The documentation seems to be a bit thin on the ground for this stuff - where should I be looking?
The razor umbraco.tv videos, the razor dynamicnode cheatsheet or the blog posts on the umbraco blog
You can also get a lot from the cultiv razor examples site
Gareth
Ok cool thanks. Nothing formal then.
Nope, also please mark this thread as resolved/answered, thanks! :)
I would if I knew how!
Just click the green checkmark at the top of the post you'd like to mark as the answer :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
ContentPicker?
Im trying to populate a link in my template from a Content Picker DataType using Razor.
<a id="slide_1" href="#">Our Operations</a>
So just the href (#) and the anchor (Our Operations).
How do I go about doing this from an embedded Macro in a template?
Would something like this work for you?
@{
var node = @Library.NodeById(Model.aliasForContentPickerType);
<a href="@node.Url">@node.Name</a>
}
Yup, perfect!! The documentation seems to be a bit thin on the ground for this stuff - where should I be looking?
The razor umbraco.tv videos, the razor dynamicnode cheatsheet or the blog posts on the umbraco blog
You can also get a lot from the cultiv razor examples site
Gareth
Ok cool thanks. Nothing formal then.
Nope, also please mark this thread as resolved/answered, thanks! :)
I would if I knew how!
Just click the green checkmark at the top of the post you'd like to mark as the answer :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.