2

this is the code of TopNavigation:

<nav class="nav" id="navigation">

                                    <!--CS: Start Top Navigation Snippet-->
                                    <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                                    <!--MS:<SharePoint:AjaxDelta runat="server" CssClass="nav" BlockElement="True" ID="DeltaTopNavigation">-->
                                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
                                    <!--MS:<SharePoint:DelegateControl runat="server" Id="topNavigationDelegate" ControlId="TopNavigationDataSource">-->
                                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><span style="display:none"><table cellpadding="4" cellspacing="0" style="font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow"><tr><td nowrap="nowrap"><span style="font-weight:bold">PortalSiteMapDataSource</span> - topSiteMap</td></tr><tr><td></td></tr></table></span><!--PE: End of READ-ONLY PREVIEW-->
                                    <!--MS:<Template_Controls>-->
                                    <!--MS:<asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="SPNavigationProvider" ID="topSiteMap" runat="server" >-->
                                    <!--ME:</asp:SiteMapDataSource>-->
                                    <!--ME:</Template_Controls>-->
                                    <!--ME:</SharePoint:DelegateControl>-->
                                    <a name="startNavigation">
                                    </a>
                                    <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderTopNavBar" runat="server">-->
                                    <!--MS:<SharePoint:AspMenu runat="server" UseSeparateCss="false" AdjustForShowStartingNode="True" StaticDisplayLevels="2" AccessKey="1" SkipLinkText="" EnableViewState="False" MaximumDynamicDisplayLevels="5" UseSimpleRendering="True" DataSourceID="topSiteMap" Orientation="Horizontal" Editable="False" ID="TopNavigationMenu" CssClass="s4-tn">-->
                                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><link rel="stylesheet" type="text/css" href="http://wtnsolsp001/_layouts/15/1033/styles/menu-21.css" /><div id="zz5_TopNavigationMenu" class=" noindex ms-core-listMenu-horizontalBox"><ul id="zz7_RootAspMenu" class="root ms-core-listMenu-root static"><li class="static"><a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" title="Direction Marketing" href="http://wtnsolsp001/sites/qualite/Pages/accueil.aspx" accesskey="1"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Marketing</span></span></a><ul class="static"><li class="static"><a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="http://wtnsolsp001/sites/qualite/Pages/accueil.aspx"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Accueil</span></span></a></li><li class="static dynamic-children"><span class="static dynamic-children menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0"><span aria-haspopup="true" class="additional-background ms-navedit-flyoutArrow dynamic-children"><span class="menu-item-text">Produits</span></span></span><ul class="dynamic"><li class="dynamic"><a class="dynamic menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="http://wtnsolsp001/sites/activia"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Activia</span></span></a></li></ul></li><li class="static"><a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="http://wtnsolsp001/sites/qualite/Pages/contact.aspx"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Contact</span></span></a></li></ul></li></ul></div><!--PE: End of READ-ONLY PREVIEW-->
                                    <!--ME:</SharePoint:AspMenu>-->
                                    <!--ME:</asp:ContentPlaceHolder>-->
                                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
                                    <!--ME:</SharePoint:AjaxDelta>-->
                                    <!--CE: End Top Navigation Snippet-->
                                </nav>

I succefully got the right navigation but not with the right show.It alywas show the StartingNode on the top but the children node are at below like this :

enter image description here

So any idea to get the 2 .

  • a simple approach can be to try and change the navigation order by moving the subsites up. This can done by using the navigation link under the look and feel section of the site settings page. – HarryB Mar 23 '16 at 13:09
  • If I use meta data , yes it works , but in my case I have to use only the structural navigation – Imen Turki Mar 23 '16 at 16:04
  • Have you tried starting with seattle master page as your base master page – HarryB Mar 24 '16 at 11:02
  • I only got the navigation from seattle master page – Imen Turki Mar 24 '16 at 11:18
  • if you are using any custom css - you can perhaps try adding that incrementally to the seattle (copy) master page and see how that changes the look of the master page. – HarryB Mar 24 '16 at 17:16
2
<nav class="nav" id="navigation">
                                <!--MS:<asp:SiteMapDataSource ShowStartingNode="false" StartingNodeUrl="sid:1002" SiteMapProvider="GlobalNavSiteMapProvider" ID="topSiteMapLevel1" runat="server">-->
                                <!--ME:</asp:SiteMapDataSource>-->
                                <!--MS:<SharePoint:AspMenu IncludeStyleBlock="True" AdjustForShowStartingNode="True"  DynamicVerticalOffset="0" ID="TopNavigationMenuLevel1" StaticDisplayLevels="2" MaximumDynamicDisplayLevels="5" runat="server" EnableViewState="true" DataSourceID="topSiteMapLevel1" AccessKey="&#60;%$Resources:wss,navigation_accesskey%&#62;" UseSimpleRendering="true" UseSeparateCss="True" Orientation="Horizontal" SkipLinkText="">-->
                                <!--ME:</SharePoint:AspMenu>-->
                            </nav>

this is the right navigation , I have to add the link of my root site to structural navigation and to change the SiteMapProvider="GlobalNavSiteMapProvider"

0

I have this markup for the navigation in my master page and it works in the same way as your desired layout for the top navigation. You can enclose this mark up in a div <div class="nav navbar-collapse collapse"> </div> if you are using bootstrap

<div data-name="TopNavigationNoFlyoutWithStartNode">
    <!--CS: Start Top Navigation Snippet-->
    <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
    <!--MS:<SharePoint:AjaxDelta ID="DeltaTopNavigation" BlockElement="true" CssClass="ms-displayInline ms-core-navigation ms-dialogHidden" runat="server">-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
    <!--MS:<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><span style="display:none"><table cellpadding="4" cellspacing="0" style="font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow"><tr><td nowrap="nowrap"><span style="font-weight:bold">PortalSiteMapDataSource</span> - topSiteMap</td></tr><tr><td></td></tr></table></span><!--PE: End of READ-ONLY PREVIEW-->
    <!--MS:<Template_Controls>-->
    <!--MS:<asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="SPNavigationProvider" ID="topSiteMap" runat="server" StartingNodeUrl="sid:1002">-->
    <!--ME:</asp:SiteMapDataSource>-->
    <!--ME:</Template_Controls>-->
    <!--ME:</SharePoint:DelegateControl>-->
    <a name="startNavigation">
    </a>
    <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderTopNavBar" runat="server">-->
    <!--MS:<SharePoint:AspMenu ID="TopNavigationMenu" runat="server" EnableViewState="false" DataSourceID="topSiteMap" AccessKey="&#60;%$Resources:wss,navigation_accesskey%&#62;" UseSimpleRendering="true" UseSeparateCss="false" Orientation="Horizontal" StaticDisplayLevels="2" AdjustForShowStartingNode="false" MaximumDynamicDisplayLevels="2" SkipLinkText="">-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
    <!--ME:</SharePoint:AspMenu>-->
    <!--ME:</asp:ContentPlaceHolder>-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
    <!--ME:</SharePoint:AjaxDelta>-->
    <!--CE: End Top Navigation Snippet-->
</div>
  • it's the same thing Harry , if i use structural navigation all the sub site set in below , it Only works with metaData – Imen Turki Mar 24 '16 at 12:53
  • is it a publishing site or a team site? – HarryB Mar 24 '16 at 14:31
  • I am also using structured navigation – HarryB Mar 24 '16 at 14:31
  • it's a publishing site – Imen Turki Mar 24 '16 at 14:34
  • if you apply the seattle master page as a test then does it render the top nav in your desired way? – HarryB Mar 24 '16 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.