NavBarLink element (Site)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Defines a hyperlink used in the top navigation area of a home page.

<NavBarLink
  Name = "Text"
  Url = "Text">
</NavBarLink>

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
Name
Required Text. Contains the text displayed for the hyperlink.
Url
Required Text. Contains the URL for the hyperlink.

Child elements

None

Parent elements

Occurrences

  • Minimum: 0
  • Maximum: Unbounded

Example

The following example specifies the links for the top navigation area of a home page.

<NavBar Name="SharePoint Top Navbar" Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;"
   Body="<a ID='onettopnavbar#LABEL_ID#' href='#URL#'
      accesskey='J'>#LABEL#</a>" ID="1002">
   <NavBarLink Name="Documents and Lists"
      Url="_layouts/[%=System.Threading.Thread.CurrentThread.
         CurrentUICulture.LCID%]/viewlsts.aspx" />
   <NavBarLink Name="Create"
      Url="_layouts/[%=System.Threading.Thread.CurrentThread.
         CurrentUICulture.LCID%]/create.aspx" />
   <NavBarLink Name="Site Settings"
      Url="_layouts/[%=System.Threading.Thread.CurrentThread.
         CurrentUICulture.LCID%]/settings.aspx" />
   <NavBarLink Name="Help" Url="javascript:HelpWindowKey("helphome")" />
</NavBar>