How to create a submenu

  1. Avatar of Camilo Rodriguez Cuaran

    Hi!, I have my main menu http://manualrkonrad.azurewebsites.net/ but in the item "Contenido del manual" I need another items as submenu, but I don't see the option for create this, anyone can help me?

    Thanks!

  2. Avatar of Audrunas

    Hello,

    For adding sub-menu items you should download demo page source code and manually edit it. Source code can be found here: https://github.com/devbridge/BetterCMS.Demo/

    You should add submenu items to Site Settings -> Sitemap as child nodes.

    After then you should update SitemapController (https://github.com/devbridge/BetterCMS.Demo/blob/master/BetterCms.Demo.Web/Controllers/SitemapController.cs) and view models to retrieve data in the tree structure.

    To display data with child nodes you should update sitemap rendering view: https://github.com/devbridge/BetterCMS.Demo/blob/master/BetterCms.Demo.Web/Views/SiteMap/Index.cshtml and use any JavaScript library for displaying sub menu items.

    Hope it helped!

  3. Avatar of Camilo Rodriguez Cuaran

    Oh yeah! I will try this in the next project.

  4. Avatar of Vince H

    Hi Audrunas,

    I tried the instructions that you mentioned from above. It did not seem working.From subMenu.cshtml codes, the parentUrl returned 'null'. Any idea?

    var parentUrl = OptionsHelper.GetValue(Model.Options, "parentUrl"); if (parentUrl != null) { Html.RenderAction("SubMenu", "Sitemap", new { area = string.Empty, parentUrl = parentUrl }); }

  5. Avatar of Augustas

    The following gets the value based on key "parentUrl" from sub menu widget options: OptionsHelper.GetValue(Model.Options, "parentUrl");

    You have to set the parentUrl yourself in page widget options in order to generate the SubMenu widget:

* Mandatory
* Mandatory
* Mandatory

Verify that you are human