Hm haven't seen it before but I've installed it now but don't really get how this will help me.. :P
EDIT: I just found some code wich were geting data from a MultiNodePicker but even there it was a foreach loop.. Im sure there must be a way to get this info without the loop.
Why do you so badly not want to do it in a loop?? What if there's more than one node picked?
You can probably do something like page.Image.First() or page.Image.First().nodeId (haven't been able to test this code yet) to get the first picked node.
How do I get a MultiNodePicker value without a loop?
I have a page with Children who has a property called "image".
I want to be able to do something like this:
foreach (var page in Model.Children) { @var imageID = page.image[0].nodeId }
Is it possible?
Hey NiQ,
Have you seen this great package? http://our.umbraco.org/projects/developer-tools/cultiv-razor-examples
I'm sure you'll find the answer in there.
Rich
Hm haven't seen it before but I've installed it now but don't really get how this will help me.. :P
EDIT: I just found some code wich were geting data from a MultiNodePicker but even there it was a foreach loop.. Im sure there must be a way to get this info without the loop.
Hi,
It's a package that shows you how to get values by using Razor for all the uComponents and umbraco datatypes.
Rich
Why do you so badly not want to do it in a loop?? What if there's more than one node picked?
You can probably do something like page.Image.First() or page.Image.First().nodeId (haven't been able to test this code yet) to get the first picked node.
Becuase I have set a limit to 1 so there is ALWAYS only one node. That's why I don't want to do a loop. :)
is working on a reply...