SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The SPNavigation property IsVisible only returns true. I have seen a lot of posts on the net stating the same thing. I know there is a way of hiding the nodes in MOSS using the PublishingWeb class, the problem I have is that we are using WSS which does not have microsoft.sharepoint.publishing.dll.

Is there a way of hiding navigation nodes in WSS dynamically?

share|improve this question

Not without writing your own sitemapprovider. I once tried setting the same properties using a WSS site that MOSS uses in it's navigation, including BlankUrl (header) and Target (open in a new window) but they didn't work because the wss sitemapprovider doesn't pass those properties when it converts the node from a SPNavigationNode to a SiteMapNode. I ended up writing my own sitemapprovider that reads the spnavigationnodecollection and passes the properties through. Here's a snippet of my code:

protected SiteMapNode SPNavigationNodeToSiteMapNode(SPNavigationNode spNode, SPWeb web)
    if (spNode == null) return null;

    SiteMapNode node = NewSiteMapNode("sid:" + spNode.Id.ToString(),
    if (spNode.Id == ROOT_ID ||
    	spNode.Id == ALT_ROOT_ID)
    	node.Url = "sid:" + spNode.Id.ToString();

    if (!string.IsNullOrEmpty((string)spNode.Properties["BlankUrl"]))
    	node.Url = string.Empty;

    foreach (object key in spNode.Properties.Keys)
    	switch (key.ToString())
    		case "Title": break;
    		case "ID": break;
    		case "ToolTip": break;
    		case "Expanded": break;
    		case "NavigateUrl": break;
    			node[key.ToString()] = spNode.Properties[key].ToString();

    return node;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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