Try Now
More in this section

Forums / Designing with Sitefinity / Templating Site Menu

Templating Site Menu

2 posts, 0 answered
  1. BlueCell
    BlueCell avatar
    3 posts
    22 Nov 2006
    17 Sep 2008
    Link to this post
    I would like my site menu to have the same look as: http://demos.telerik.com/ASPNET/Prometheus/Menu/Examples/Functionality/Templates/DefaultCS.aspx

    At a menu depth of 1, I'd like to show the "default" menu style, but at a menu depth of 2, I'd like to show a more templated kind of sub menu (as shown in the sample).

    As pages do not have any icon property, I can imagine I have to build the logic  for this myself. My first guess would be to find page icons according to the page name. Do I have to link the icons to the menu items, aswell as creating the templates,  in a custom control?  Could you give some pointers on how you would implement such a thing?
  2. Ivan
    Ivan avatar
    478 posts
    16 Jun 2015
    20 Sep 2008
    Link to this post
    Hello BlueCell,

    there are two ways in which you can achieve the desired functionality. In both ways you will need to do some custom development:

    1. You can bind the RadMenu to SiteMap (this is how we do it in our SiteMenu control - you can find the source of this control in : ~/Sitefinity/UserControls/Navigation
    Then you would need to handle ItemDataBound event of the RadMenu and you can alter the properties of each menu item as it is bound (e.g. you can read the page name and assign it icon, change the css class and so on)

    2. Second way is to built RadMenu from the SiteMap using the typical recursive function for building a tree. Once again, you will have access to all the properties of the RadMenuItem before you add it to the tree collection (Menu) and therefore you will be able to alter its properties, such as icon or css class.

    You can find more about RadMenu and RadMenuItem objects here: http://www.telerik.com/help/aspnet-ajax/menu_itemsoverview.html

    I hope you'll find this information helpful. Please let us know if there is anything else we can do for you.

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered