Menu Control by Johan Carnescog

Topics: Controls
Nov 21, 2012 at 4:31 AM

I have used this control for a long time and really like it.  I have updated it to work with v2.5 but have another question.

How can it be updated to include all the administration menu items

The below highlighted are missing:

    Dashboard
    Blogs
    Posts
    Comments
    Pages
    Tracking
    Controls
    Appearance
    Users
    Settings
    My Profile
    Change password

I did some searching and can see in the file _menu.cshtml and I think this provides direction on what I want to accomplish but I not sure of that.

Here is the code in the menu control that is applicable:

// Add admin links
            if ((ShowAdministrationPage.ToString()).ToLower() != "false")
            {
                if (Page.User.Identity.IsAuthenticated)
                {
                    sb.AppendFormat("
  • {0}<!--[if IE 7]><!--><!--<![endif]--><!--[if lte IE 6]>
    <![endif]-->
      ",AdministrationText); foreach (SiteMapNode adminNode in SiteMap.Providers["SecuritySiteMap"].RootNode.ChildNodes) { if (adminNode.IsAccessibleToUser(HttpContext.Current)) { sb.AppendFormat("
    • {1}\n", adminNode.Url, Translate(adminNode.Title)); } } sb.Append("
    <!--[if lte IE 6]>
    <![endif]-->"); } } // Put menu into session variable for further use HttpContext.Current.Session["SessionMenu"] = sb.ToString(); HttpContext.Current.Session["SessionMenuTimeStamp"] = DateTime.Now.ToString(); sb.Append("
      "
      ); writer.Write(sb); base.Render(writer); }
    • I think what needs to be amended is the foreach statement but I really don't know.

      Am I on the right track?  Can someone help a hack out?

      Thanks