Forum Discussion

Miguel Isidoro's avatar
Miguel Isidoro
Brass Contributor
Oct 21, 2021

SharePoint 2019 Publishing Site - Problem with quick launch menu

Hi,

 

I am using https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ms476607(v=office.14) for a public web site in SharePoint 2019 that is showing quick launch navigation but with a unexpected behavior:

 

<SharePoint:AjaxDelta ID="AjaxDelta1" class="" role="navigation" BlockElement="true" runat="server">

                        <SharePoint:SPNavigationManager

                            ID="SPNavigationManager1"

                            runat="server"

                            QuickLaunchControlId="V4QuickLaunchMenu"

                            ContainedControl="QuickLaunch"

                            EnableViewState="false">

                            <SharePoint:DelegateControl ID="DelegateControl2" runat="server" ControlId="QuickLaunchDataSource">

                                <Template_Controls>

                                    <asp:SiteMapDataSource                                                                                 SiteMapProvider="SPNavigationProvider" ShowStartingNode="False" id="QuickLaunchSiteMap" StartingNodeUrl="sid:1025" runat="server" />

                                </Template_Controls>

                            </SharePoint:DelegateControl>

 

<SharePoint:AspMenu ID="QuickLaunchMenu" runat="server" EnableViewState="false" DataSourceID="QuickLaunchSiteMap" UseSimpleRendering="true" Orientation="Vertical" AdjustForShowStartingNode="true" SkipLinkText="" RenderingMode="List" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="1" StaticSubMenuIndent="0" Editable="false">

/>

                        </SharePoint:SPNavigationManager>

 

                    </SharePoint:AjaxDelta>

 

The menu data source is managed metadata that is being used for both the top menu and quick launch menu.

 

The top level menu shows the 1st and second navigation levels and the quick launch navigation is intended to show the second and third levels.

 

Top level menu is working fine but quick launch navigation is not as intended.

 

The behavior for quick launch is:

 - When we are in the 2nd level (1st level shown in the quick launch menu), all works fine. 2nd and 3rd (if they exist) menu items are shown. When I click in the second level, all works fine. The menu looks as follows:

 

 

 

When I click in the 3rd level, only 3rd level menu items are shown (NOT WHAT WE WANT)

 

 

 

It seems as if the menu is always showing the current level menu items and its children (if they exist).

Is there any way in the <asp:Menu> and/or <SharePoint:SPNavigationManager> controls to make the both the second level and third level be shown in the quick launch menu when the 3rd level menu item is selected?

 

I already tried playing with both controls properties without success. It seems like the datasource (the site map provider) just returns the all the nodes of the same level of the selected node, the selected node itself and their children (if they exist).

 

Tried to change in asp:menu, the properties: AdjustForShowStartingNode, StaticDisplayLevels, MaximumDynamicDisplayLevels, StaticSubMenuIndent and in the SiteMapDataSource control with the ShowStartingNode, StartFromCurrentNode and removing the

StartingNodeUrl parameter.

 

Thanks

  • Hi,

     

    Problem solved.

     

    Removed the ControlId="QuickLaunchDataSource" attribute from the <SharePoint:DelegateControl> and removed the "StartingNodeUrl="sid:1025" attribute from the asp:SiteMapDataSource control.

     

    Other changes in bold.

     

    <SharePoint:AjaxDelta ID="AjaxDelta1" class="" role="navigation" BlockElement="true" runat="server">
    <SharePoint:SPNavigationManager
    ID="SPNavigationManager1"
    runat="server"
    QuickLaunchControlId="V4QuickLaunchMenu"
    ContainedControl="QuickLaunch"
    EnableViewState="false">
    <SharePoint:DelegateControl ID="DelegateControl2" runat="server">
    <Template_Controls>
    <asp:SiteMapDataSource
    SiteMapProvider="CurrentNavigationTaxonomyProvider"
    ID="QuickLaunchSiteMap"
    runat="server"
    EnableViewState="False"
    ShowStartingNode="False"
    StartFromCurrentNode="False"
    StartingNodeOffset="1" />
    </Template_Controls>
    </SharePoint:DelegateControl>

    <SharePoint:AspMenu
    ID="QuickLaunchMenu"
    runat="server"
    EnableViewState="false"
    DataSourceID="QuickLaunchSiteMap"
    UseSimpleRendering="true"
    Orientation="Vertical"
    AdjustForShowStartingNode="true"
    SkipLinkText=""
    RenderingMode="List"
    StaticDisplayLevels="3"
    MaximumDynamicDisplayLevels="0"
    StaticSubMenuIndent="0"
    Editable="false" />
    </SharePoint:SPNavigationManager>
    </SharePoint:AjaxDelta>

     

    Thanks

    Miguel

  • Hi,

     

    Problem solved.

     

    Removed the ControlId="QuickLaunchDataSource" attribute from the <SharePoint:DelegateControl> and removed the "StartingNodeUrl="sid:1025" attribute from the asp:SiteMapDataSource control.

     

    Other changes in bold.

     

    <SharePoint:AjaxDelta ID="AjaxDelta1" class="" role="navigation" BlockElement="true" runat="server">
    <SharePoint:SPNavigationManager
    ID="SPNavigationManager1"
    runat="server"
    QuickLaunchControlId="V4QuickLaunchMenu"
    ContainedControl="QuickLaunch"
    EnableViewState="false">
    <SharePoint:DelegateControl ID="DelegateControl2" runat="server">
    <Template_Controls>
    <asp:SiteMapDataSource
    SiteMapProvider="CurrentNavigationTaxonomyProvider"
    ID="QuickLaunchSiteMap"
    runat="server"
    EnableViewState="False"
    ShowStartingNode="False"
    StartFromCurrentNode="False"
    StartingNodeOffset="1" />
    </Template_Controls>
    </SharePoint:DelegateControl>

    <SharePoint:AspMenu
    ID="QuickLaunchMenu"
    runat="server"
    EnableViewState="false"
    DataSourceID="QuickLaunchSiteMap"
    UseSimpleRendering="true"
    Orientation="Vertical"
    AdjustForShowStartingNode="true"
    SkipLinkText=""
    RenderingMode="List"
    StaticDisplayLevels="3"
    MaximumDynamicDisplayLevels="0"
    StaticSubMenuIndent="0"
    Editable="false" />
    </SharePoint:SPNavigationManager>
    </SharePoint:AjaxDelta>

     

    Thanks

    Miguel

Resources