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
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ IPublishedContent practiceAreas; foreach (IPublishedContent page in Model.CurrentPage.Children) { if (page.Name == "Practice Areas") { practiceAreas = page; break; } } } <ul class="homePraticeAreasNav"> @foreach (var item in practiceAreas.Children) { <li><a class="navigation" href="@item.Url()">@item.Name</a></li> } </ul>
I'm getting a "Use of unassigned local variable" on 'practiceAreas' on the foreach loop. Anyone know why?
Scratch my question... looks like this is what I needed:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var node = Model.CurrentPage.Descendants().Where(x => x.Name == "Practice Areas").FirstOrDefault(); } <ul class="homePraticeAreasNav"> @foreach (var item in node.Children() ) { <li><a class="navigation" href="@item.Url()">@item.Name</a></li> } </ul>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Macro - Use of unassigned local variable
I'm getting a "Use of unassigned local variable" on 'practiceAreas' on the foreach loop. Anyone know why?
Scratch my question... looks like this is what I needed:
is working on a reply...