Kentico CMS 6.0 Tutorial ASPX

Main menu

Main menu

Previous topic Next topic Mail us feedback on this topic!  

Main menu

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Now we will add a dynamic drop-down menu to our master page. The drop-down menu can be implemented using either the CMSMenu or CMSListMenu control. The first option is easier to use if you are not familiar with complex CSS styles, so we will use it now.

 

Please note: If you prefer a drop-down menu based on CSS styles and UL/LI elements, you can try using the CMSListMenu later (you can find more details and examples in theKentico CMS Controls Reference).

 

Switch to the Source mode of the MyMaster.master page and drag and drop the CMSMenu control inside the <div class="MainMenu"> element. Remove the original <table> element used for the static menu. The main menu section will look like this:

 

<!-- main menu -->
<div class="MainMenu">
  <cms:CMSMenu ID="CMSMenu1" runat="server" />
</div>

 

Now switch back to the Design tab and set the following properties of the CMSMenu control:

 

Path: /%

Layout: Horizontal

CSSPrefix: ;sub

Cursor: Pointer

 

The Path property specifies that the menu should start displaying pages from the root of the site structure. The Layout property allows you to choose between a vertical and horizontal menu. The CSSPrefix property specifies the names of CSS classes applied to the main menu (standard style class names) and for sub-menus (all style class names will have the sub prefix). The Cursor property specifies the type of cursor displayed when a user hovers over the menu.

 

Save the changes.

 

 

 

Kentico CMS Controls and Web Parts

 

While Kentico CMS is delivered with a set of flexible server controls in the CMS.Controls.dll library, large amounts of functionality are only available through web parts that are stored in the CMSWebParts folders. These web parts are standard ASCX user controls and they can be used on both portal engine templates and on ASPX pages. You only need to drag and drop the web parts onto your ASPX page and set their properties in the Properties window of Visual Studio. All CMS controls have a corresponding web part as well.