Ok cool, and you want to find all nodes that are the children of the first level 2 node up the tree from the current node that have a certain value selected from that dropdown, e.g. "mything" and loop through them, right?
Great! One additional bit of advice, when using MVC, you should never have @using umbraco.MacroEngines that is from the legacy "Razor Macros" and has no use within MVC templating.
Need help with Where and Contains 6.1.6 Razor
Good afternoon Umbracians.
I am trying to get a list of items from my tree where a dropdown field = a certain value.
I have tried so many different ways and failed. Any advice will be grateful.
Here is my code:
Hi Philip,
It looks like this is a MVC Partial View, could you confirm?
Jeavon
Edit: I see you are using Umbraco v6.1.6
Also is your dropdown with property alias "serviceCenterType" a "Dropdown list" or a "Dropdown list, publishing keys"?
Yes, this is a MVC partial and the DataType is DropDownList.
Ok cool, and you want to find all nodes that are the children of the first level 2 node up the tree from the current node that have a certain value selected from that dropdown, e.g. "mything" and loop through them, right?
Home > Centers > Service Center Address
Above is the how the tree is.
I want to get all the nodes under Centers that have a serviceCenterType of XYZ.
Ok, unless I'm missing something, I think this should do it?
To ignore case, you can change it to:
Jeavon to the rescue.
Worked great.
Great! One additional bit of advice, when using MVC, you should never have
@using umbraco.MacroEngines
that is from the legacy "Razor Macros" and has no use within MVC templating.is working on a reply...