Wednesday, 28 August 2013

Sharepoint Menu enable parent navigation

Sharepoint Menu enable parent navigation

On the v4.master I have an Sharepoint:Menu, and I would like to know how
to enable the parent link. Wich property should I change on the
SharePoint:AspMenu ?
At the moment the parent has an anchor with href="#", but I would like to
configure it to be clicable and redirected to the correct link.
The ASP.Net code:
<div>
<SharePoint:DelegateControl runat="server"
ControlId="QuickLaunchDataSource">
<Template_Controls>
<asp:SiteMapDataSource
SiteMapProvider="SPNavigationProvider"
ShowStartingNode="True" id="QuickLaunchSiteMap"
StartingNodeUrl="sid:1025" runat="server" />
</Template_Controls>
</SharePoint:DelegateControl>
<SharePoint:UIVersionedContent UIVersion="3" runat="server">
<ContentTemplate>
<SharePoint:AspMenu id="QuickLaunchMenu"
runat="server" DataSourceId="QuickLaunchSiteMap"
Orientation="Vertical" StaticDisplayLevels="2"
ItemWrap="true" MaximumDynamicDisplayLevels="0"
StaticSubMenuIndent="0" SkipLinkText=""
CssClass="s4-die">
<LevelMenuItemStyles>
<asp:menuitemstyle CssClass="ms-navheader" />
<asp:menuitemstyle CssClass="ms-navitem" />
</LevelMenuItemStyles>
<LevelSubMenuStyles>
<asp:submenustyle CssClass="ms-navSubMenu1" />
<asp:submenustyle CssClass="ms-navSubMenu2" />
</LevelSubMenuStyles>
<LevelSelectedStyles>
<asp:menuitemstyle
CssClass="ms-selectednavheader" />
<asp:menuitemstyle CssClass="ms-selectednav" />
</LevelSelectedStyles>
</SharePoint:AspMenu>
</ContentTemplate>
</SharePoint:UIVersionedContent>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<SharePoint:AspMenu id="V4QuickLaunchMenu"
runat="server" EnableViewState="false"
DataSourceId="QuickLaunchSiteMap"
UseSimpleRendering="true" UseSeparateCss="false"
Orientation="Vertical" StaticDisplayLevels="3"
MaximumDynamicDisplayLevels="3" SkipLinkText=""
CssClass="s4-ql" />
</ContentTemplate>
</SharePoint:UIVersionedContent>
</div>
The HTML is generated as:
CHILD NODE:
<li class="static">
<a class="static menu-item" href="/aaa/bbb">
<span class="additional-background">
<span class="menu-item-text">aadasa</span>
</span>
</a>
</li>
PARENT NODE:
<li class="static">
<a class="static menu-item close" href="#">
<span class="additional-background">
<span class="menu-item-text">dasd</span>
</span>
</a>
</li>

No comments:

Post a Comment