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
I have one dokument type with 5 content picker. I whant do a razor script who give me links to this 5 ithem that been picked, and the linkname should be same as the node-name on the node who was pecked.
Can any one show how I can do that?
Assuming that your pickers are called: contentPicker1, contentPicker2, contentPicker3, contentPicker4 and contentPicker5:
@{ var picker1 = @Model.NodeById(Model.contentPicker1); }<a href="@picker1.Url">@picker1.Name</a>@{ var picker2 = @Model.NodeById(Model.contentPicker2); }<a href="@picker2.Url">@picker2.Name</a>
And the same for 3-5.
Sebastiaan, why doesn't this block work? Its throwing up a 'Compliation Error'
Is there anything obviously wrong with my 'foreach' here?
@foreach(var page in @Model.Children()){
<li>
<a href="@page.Url">@page.Name</a>
</li>
}
Probably because Children is not a method, it's a property. So you would do:
@foreach(var page in Model.Children){ <li><a href="@page.Url">@page.Name</a></li>}
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
Get url and node name from content picker?
I have one dokument type with 5 content picker. I whant do a razor script who give me links to this 5 ithem that been picked, and the linkname should be same as the node-name on the node who was pecked.
Can any one show how I can do that?
Assuming that your pickers are called: contentPicker1, contentPicker2, contentPicker3, contentPicker4 and contentPicker5:
And the same for 3-5.
Sebastiaan, why doesn't this block work? Its throwing up a 'Compliation Error'
Is there anything obviously wrong with my 'foreach' here?
Probably because Children is not a method, it's a property. So you would do:
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.