Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have the following markup in my onet file. All i want to do is show these 2 sections in the quick launch area and NOTHING else. The code below adds these 2 sections but also adds extra sections e.g. Libraries, Recently Modified

I dont want to add css or javascript to hide unwanted navbars.

<NavBars>
<NavBar Name="a" Url="myurl1" ID="1008">
  <NavBarPage Name="b" Url="myurl2" />
  <NavBarPage Name="c" Url="myurl3" />
</NavBar>
<NavBar Name="d" Url="myurl4" ID="1009">
  <NavBarPage Name="e" Url="myurl5" />
</NavBar>
<NavBars>

How do i do this in the onet file?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

SharePoint automatically set those links in the quicklaunch. I suggest to create a feature with a receiver and add this feature to your ONET. Programmatically add those links to the quicklaunch.

Example:

SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
SPNavigationNode navNode = new SPNavigationNode("MyLink", "http://mylink.com",false);
nodes.AddAsFirst(navNode);

Btw. "Recently modified" is a section only available within Wiki page libraries. You can only hide this by hiding a placeholder in the masterpage or with some CSS

<style type="text/css">
.s4-recentchanges
{
    display:none;
}
</style>
share|improve this answer
add comment

Your Answer

 
discard

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.