0

I want to create a custom user control that will display my own top navigation in my publishing site's master page.

I know another option is to use sharepoint's own top navigation and then customize it using CSS etc. but I have tried this thing and can't get my head around it. I mean it seems so difficult and very limited in functionality so I am trying to make top navigation using user control.

Is there some API that will give me all links in navigation in SharePoint? Like for e.g. SPNavigation which I can call and iterate through all elements including parent or child?

What are the drawbacks of making top navigation as user control in master page?

Will end user be still be able to use Navigation options in SharePoint Administration?

0

if you do not need another html structure or rendered Information than the default sharepoint navigation, then it is recomended to brand it using CSS and JavaScript.

Otherwise you have to create your own control. In your Control you can use the default sharepoint navigation control with a default or custom Site Map Provider.

This example shows howto build an own quick launch control. You can adopt this logic for a top navigation. Therefor you only need a different Site Map Provider.

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

<SharePoint:AspMenu 
id="V4QuickLaunchMenu" 
runat="server" 
EnableViewState="false" 
DataSourceId="QuickLaunchSiteMap" 
UseSimpleRendering="true" 
UseSeparateCss="false" 
Orientation="Vertical" 
StaticDisplayLevels="2" 
MaximumDynamicDisplayLevels="0" 
SkipLinkText="" 
CssClass="s4-ql" />

More Informationen about this topic you will find on Technet.

But this control is rendering a html structure which is fix. So you cannot change it. If you wanna have your own html structure then you need C# and ASP.Net

If you wanna customize the default navigation using CSS and JavaScript then you can try this

I hope i could help. If not let me know!

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.