In a Partiel View Macro, plaved on a page with subpages that has the category set, i want to iterate the possible category values and under a heading list all pages that have the value in the categoy.
I can iterate, but the selection returns 0 node for all the values that are listet.
What an I doing wrong?
@{ var iterator = umbraco.library.GetPreValues(1142); iterator.MoveNext(); var preValues = iterator.Current.SelectChildren("preValue", ""); while (preValues.MoveNext()) { var type = preValues.Current.Value; <h2>@type</h2> var selection = CurrentPage.Children.Where("category == " + type).OrderBy("Name"); @selection.Count() } }
iterate prevalues and list page with value
Using umbraco 7.2.1 on windows 7, .net 4.0
I got a custom datatype (dropdown) "category".
In a Partiel View Macro, plaved on a page with subpages that has the category set, i want to iterate the possible category values and under a heading list all pages that have the value in the categoy.
I can iterate, but the selection returns 0 node for all the values that are listet.
What an I doing wrong?
@{
var iterator = umbraco.library.GetPreValues(1142);
iterator.MoveNext();
var preValues = iterator.Current.SelectChildren("preValue", "");
while (preValues.MoveNext())
{
var type = preValues.Current.Value;
<h2>@type</h2>
var selection = CurrentPage.Children.Where("category == " + type).OrderBy("Name");
@selection.Count()
}
}
Hi there, if I've understood you correctly, give this a try:
Jeavon
Perfect :)
Great!
is working on a reply...