Getting children results and splitting into rows of 3
Hi All,
Its been about 3 years since I've worked on a full blown Umbraco project and I'm a bit rusty with my razor syntax.
I've taken the standard List nodes from changeable resource.
@if (Model.MacroParameters["startNodeId"] != null) { @* Get the start node as a dynamic node *@ var startNode = Umbraco.Content(Model.MacroParameters["startNodeId"]);
if (startNode.Children.Where("Visible").Any()) { <ul> @foreach (var page in startNode.Children.Where("Visible")) { <li><a href="@page.Url">@page.Name</a></li> } </ul> } }
Of which it will always return 6 items but I want to split these onto two rows of 3 like so
@if(Model.MacroParameters["startNodeId"]!=null) { @*Get the start node as a dynamic node *@ var startNode =Umbraco.Content(Model.MacroParameters["startNodeId"]);
Getting children results and splitting into rows of 3
Hi All,
Its been about 3 years since I've worked on a full blown Umbraco project and I'm a bit rusty with my razor syntax.
I've taken the standard List nodes from changeable resource.
Of which it will always return 6 items but I want to split these onto two rows of 3 like so
But cant for the live of me remeber how to do it.:(
Thanks in advance.
Tom
Hi Tom.
Take a look at this simple inGroupOf, example I think that it can help you.
https://gist.github.com/nul800sebastiaan/1067257
And you can find the documentation here
hope this help you,
/Dennis
Hi Dennis! I want show content paragraph
But i can't. You can help me!
is working on a reply...