MenuTreeFor(HtmlHelper,CmsPage,CmsPage,Object) Method

Example 

The active page in the menu tree.
The root page to render the tree from.
Additional Html attributes to apply to the menu. Use itemClass to apply a class to items in list, linkClass to apply a class to links in list and selectedItemClass to apply a class to the active element.
Creates a menu tree based on a root and a current page.

Syntax

'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function MenuTreeFor( _
   ByVal helper As HtmlHelper, _
   ByVal page As CmsPage, _
   ByVal rootPage As CmsPage, _
   ByVal htmlAttributes As Object _
) As IHtmlString

Parameters

helper
page
The active page in the menu tree.
rootPage
The root page to render the tree from.
htmlAttributes
Additional Html attributes to apply to the menu. Use itemClass to apply a class to items in list, linkClass to apply a class to links in list and selectedItemClass to apply a class to the active element.

Return Value

A hierarcic Html list representing the menu tree.

Example

@Html.MenuTreeFor(Model.CurrentPage, PageFactory.GetPage(Model.CurrentPage.RootId), new { @class = "nav nav-pills nav-stacked", selectedItemClass = "active" })

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

This documentation was created using Document! X from Innovasys