Add SPNavigation header and link programmatically

In the user interface you can choose if you want to add a heading or a link node to the navigation.
image
Notice that my heading has no URL, but when you try programmatically to add the SPNavigation string.Empty is not allowed. So I used the blog Add SPNavigation Heading without link functionality.
Here is my implementation.
STEP 1:Add a method MakeHeaderNode and MakeLinkNode to a new class. It is the property NodeType that makes the magic happen.
image
STEP 2:
image
I hope this was useful.

Reacties

Populaire posts