Custom Navigation in Sharepoint

http://msdn.microsoft.com/en-us/library/ms558975.aspx

SharePoint Server 2010 takes advantage of ASP.NET pluggable navigation—the Provider model.

Two classes are used to make navigation work: PortalSiteMapDataSource and PortalSiteMapProvider.

Horizontal and vertical menus are declared in master page markup. The following example declares a horizontal menu.

<SharePoint:AspMenu ID=”GlobalNav” Runat=”server”
DataSourceID=”GlobalNavDataSource”
Orientation=”Horizontal
StaticDisplayLevels=”1″ Number of hierarachy to disp;lay
MaximumDynamicDisplayLevels=”1″ /> number of level to show in dynamic display

When the master page markup includes the DataSourceID=”GlobalNavDataSource” attribute, the application returns a PortalSiteMapDataSource object.

<PublishingNavigation:PortalSiteMapDataSource ID=”GlobalNavDataSource”
Runat=”server”
SiteMapProvider=”CombinedNavSiteMapProvider”
ShowStartingNode=”false”
StartFromCurrentNode=”true”
StartingNodeOffset=”0″
TrimNonCurrentTypes=”Heading”
TreatStartingNodeAsCurrent=”true” />

http://msdn.microsoft.com/en-us/library/bb897739.aspx

Customizing Navigation and Providers

Customize in two ways:

  1. Using CSS
  2. Write your own .NET controls

Sharepoint also provides default navigation components that you can customize, such as (1) Content by Query Web Part (CQWP) and (2) Table of Contents web Part

You should use the SharePoint Server 2010 caching and security trimming infrastructure instead of writing your own caching and security trimming in a custom provider by deriving from the default providers. Derive a custom provider class from Sharepoint 2010 Site Map Provider (Portal siteMap Provider), instead of System.Web.SiteMapProvider.

Derived from PortalSiteMapProvider; override GetChildNodes

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: