Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello Our.Community
I have a Problem. I want to write a Macro that displays me first the Children and then the Childrens Children.
Here is my Structure.
and i want now to Display something like:
Präsidenten
-Friedli Ludwig
-Emmenegger Josef
Vizepräsidenten
-Wigger Josef
-Emmenegger Walter
is that possible? i have the following macro at the moment
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var selection = CurrentPage.Children.Where("Visible"); } @if (selection.Any()) { foreach (var item in selection) { <div class="row"> <div class="col-sm-1 col-xs-0"> </div> <div class="col-sm-5 col-xs-12"> <p class="text">@item.titel</p><br /> </div> <div class="col-sm-5 col-xs-12 text"> </div> </div> { var selection2 = (@item.page).Children.Where("Visible"); } foreach (var item2 in selection2) { <p>@item2.MitgliederName</p> } } }
but i get the following error:
Compiler Error Message: CS0103: Der Name 'selection2' ist im aktuellen Kontext nicht vorhanden.
english: selection2 does not exist.
Source Error:
Line 20: Line 21: { var selection2 = (@item.page).Children.Where("Visible"); }
Line 22: foreach (var item2 in selection2)
Line 23: {
Line 24:
what am i doing wrong?
i solved the problem.
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var selection = CurrentPage.Children.Where("Visible"); } @if (selection.Any()) { foreach (var item in selection) { <div class="row"> <div class="col-sm-1 col-xs-0"> </div> <div class="col-sm-5 col-xs-12"> <p class="text">@item.titel</p><br /> </div> <div class="col-sm-5 col-xs-12 text"> </div> </div> var selection2 = (@item).Children.Where("Visible"); foreach (var item2 in selection2) { <p>@item2.MitgliederName</p> } } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco Childrens Children
Hello Our.Community
I have a Problem. I want to write a Macro that displays me first the Children and then the Childrens Children.
Here is my Structure.
and i want now to Display something like:
Präsidenten
-Friedli Ludwig
-Emmenegger Josef
Vizepräsidenten
-Wigger Josef
-Emmenegger Walter
is that possible? i have the following macro at the moment
but i get the following error:
Compiler Error Message: CS0103: Der Name 'selection2' ist im aktuellen Kontext nicht vorhanden.
english: selection2 does not exist.
Source Error:
Line 20:
Line 21: { var selection2 = (@item.page).Children.Where("Visible"); }
Line 22: foreach (var item2 in selection2)
Line 23: {
Line 24:
what am i doing wrong?
i solved the problem.
is working on a reply...