i'm sure i've used it before, just not sure what project... don't know about tom's example (no link)... i'll see if i can find the example (no promises tho)
foreach (var i in m.ChildrenAsList.Where(y=>y.GetProperty("umbracoNaviHide").Value !="1").Select(x=>x.NodeTypeAlias).Distinct()){ <li><a href="#filter" data-option-value="">@i</a></li> }
Display a NodeTypeAlias Once only from a list
Can some explains how do i get the Name of NodeTypeAlias Once only from a list of Node from a folder which contains 10 different Document Type.
The idea behind this is to be able to display the different NodeTypeAlias once in such a way that filtering of content can be done by using css.
I tried something like this but doesnt work. Any suggestions please?
So far the grouping is working but how do i get it to display the value once only instead the grouping?
well seems like
is doing the trick
Fuji,
Can't you use .Distinct() to get unique doc types?
/Dirk
Hi Dirk,
Did saw a post from Tom about using .Distinct() values but didnt get to work though.
There must be a better way instead of using Helpers here.
i'm sure i've used it before, just not sure what project... don't know about tom's example (no link)... i'll see if i can find the example (no promises tho)
/Dirk
here is the url to Tom solution
http://our.umbraco.org/forum/developers/razor/27295-Find-and-count-unique-values-in-a-dynamicNodeList-#
Ah ok, got it, my scenario was a tiny bit more complex. Anyway, should get it working using
var aliases = Model.Children.Select(x => x.NodeTypeAlias).Distinct();
/Dirk
Hi Dirk,
Got it working in a neater way !
is working on a reply...