In Umbraco 8 I am trying to make a single collection from multiple categories for filtering, is this possible.
I have a page which has children.
Each of these children has a multinode picker that selects a collection of items. Each of these node pickers point to a parent node with children... I want to just get at these children in one go
I would like to create a selection of just the possible children so that collection can be filtered by price.
The very long way round to get to each child is as follows. (This is just my test list to make sure I can get to them at all)
@{ var selection = Model.Children.Where(x => x.IsVisible()).ToArray(); }
@if (selection.Length > 0){
<ul>
@foreach (var item in selection){
if(item.HasValue("categoryCollections")){
@foreach(var catsel in item.Value<IEnumerable<IPublishedContent>>("categoryCollections")){
if(catsel.Children.Any()){
var prodselection = catsel.Children.Where(x => x.IsVisible()).ToArray();
<p>Has Children</p>
<ul>
@foreach(var productItem in prodselection){
<li><a href="@productItem.Url">@productItem.Name | @productItem.Value("priceGBP")</a></li>}
</ul>}}}}}
Is there a way to create a selection of only the productItem nodes from one query, so I can organise them by price ?
In Umbraco 8 I am trying to make a single collection from multiple categories for filtering, is this possible.
I have a page which has children.
Each of these children has a multinode picker that selects a collection of items. Each of these node pickers point to a parent node with children... I want to just get at these children in one go
I would like to create a selection of just the possible children so that collection can be filtered by price.
The very long way round to get to each child is as follows. (This is just my test list to make sure I can get to them at all)
Is there a way to create a selection of only the productItem nodes from one query, so I can organise them by price ?
Hey Rob,
isn't it possible to do something like
I'm not sure what property the multi node picker uses, if its items or something else, but I guess something like this is what you are looking for?
Dee
Works a treat thanks
is working on a reply...