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

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.

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

How do i do this in the onet file?

share|improve this question
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.


SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
SPNavigationNode navNode = new SPNavigationNode("MyLink", "",false);

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">
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.