Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
EDIT: Annoying that I can't paste html in here.
I am trying to wrap a div around an element if the level is equal to 1 (submenu). I'm having a hard time getting this to work. Could someone have a look and see if my syntax is messed up or if I am going about this the wrong way?@using DotNetNuke.Web.DDRMenu;@using System.Dynamic; @inherits DotNetNuke.Web.Razor.DotNetNukeWebPage@{ var root = Model.Source.root; }@helper RenderNodes(IList nodes, int level){ if (nodes.Count > 0) { if (level == 1) { Response.Write(""); } @foreach (var node in nodes) { var cssClasses = new List(); if (node.First) { cssClasses.Add("first"); } if (node.Last) { cssClasses.Add("last"); } if (node.Selected) { cssClasses.Add("active"); } //if (node.HasChildren()) { cssClasses.Add("dropdown"); } var classString = new HtmlString((cssClasses.Count == 0) ? "" : (" class=\"" + String.Join(" ", cssClasses.ToArray()) + "\"")); @if (node.Enabled) { @node.Text } else { @node.Text } } @if (level == 1) { Response.Write(""); } }}@RenderNodes(root.Children, 1)