How to add new SPNavigationNode to Quick Link as type Link and not Heading

In SharePoint 2010, if you add a new SPNavigationNode as a child to a Heading link, then the type of the new link will automatically be Link:

If you however add it as a root level node, then the type will be Heading:

Use the following code to add a root level node as type Link:

using (var site = new SPSite("http://myServer"))
	using (var web = site.OpenWeb())
		var newNode = new SPNavigationNode("Root Level Link", "", true);
		newNode = web.Navigation.QuickLaunch.AddAsFirst(newNode);
		newNode.Properties.Add("NodeType", "AuthoredLinkPlain");

newNode.Properties.Add(“NodeType”, “AuthoredLinkPlain”) is the magic line that makes it works.


About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in Branding, SharePoint 2010. Bookmark the permalink.

Leave a Reply

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

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

Facebook photo

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

Connecting to %s