Piranha CMS - adding custom menu highlighting and selected menu item

161 views Asked by At

I have 3 different controllers for the 3 menu items and I have specified the SelectedActions for all the 3. But always it selects all the 3 menu items. Can you look into the following code and let me know if I have to correct anything?

           Piranha.WebPages.Manager.Menu.Where(m => m.InternalId == "Eagle").Single().Items.Add(
           new Manager.MenuItem()
           {
               Name = "aaa",
               Action = "Index",
               Controller = "Media",
               Permission = "ADMIN",
               SelectedActions = "Index,Edit"                                               
           });

        Piranha.WebPages.Manager.Menu.Where(m => m.InternalId == "Eagle").Single().Items.Add(
           new Manager.MenuItem()
           {
               Name = "bbb",
               Action = "Index",
               Controller = "Attest",
               Permission = "ADMIN",
               SelectedActions = "Index"

           });

        Piranha.WebPages.Manager.Menu.Where(m => m.InternalId == "Eagle").Single().Items.Add(
           new Manager.MenuItem()
           {                  
               Name = "ccc",
               Action =  "Index",
               Controller = "Order",
               Permission = "ADMIN",
               SelectedActions = "Index,Details"
           });

Even when I moved all the 3 menu code into a single controller, there was no change in the bahaviour!

0

There are 0 answers