Warning: Do not delete the Navbars section from the onet.xml
May 11th, 2006 // 5:05 pm @ Amar
I recently ran across a problem with the Navbars section in Onet.xml. Let me explain what I did.
I had a template which did not use the quick launch bars, and had them removed from the aspx files. So I thought of cleaning up the onet.xml also. If I completely removed the Navbars section from onet.xml, I believe my site was crasing on creation. So, I removed some of the Navbar sections in the process to tidy up my site definition, and kept the site settings stuff. Everything was fine. The system worked nicely and I had all my customisation working perfectly. Then I hit a serious glitch.
Go into any list and modify its settings, go to general settings, and try to toggle the list setting of On Quick Launch Bar. It will always reset to No, as soon as you click Ok. Many people had complained on the boards that they were unable to set the list to appear on the quick launch bar, and the setting toggled to No everytime. It seems the Navbar section was the source.
I replaced the Navbars section in my site’s onet.xml. But the damage was done. Any new sites which I create from this template, were fine. But the sites which were already created using the old template ( one without the Navbar sections ), did not allow me to toggle the quick launch bar setting at all. Only option was to delete and re-create those sites.
Also, I did not spend much time on this, but the list type which were removed from the Navbar section on onet, were the ones, affected with this problem.
I know it is not advisable to modify onet.xml, but we do not live in a perfect world. It is a necessary evil. But do not remove those navbar sections, even if you are not using the quick launch bar in your pages. Go ahead and remove it from the aspx pages, but keep the onet stuff in.
I still can’t figure out what’s the link to that setting and the Navbar section of onet.xml. After all, when I toggle that value, it is just a small update to one of the boolean fields in the database. No idea how is onet linked to that functionality. Anyways, to conclude, do not remove the Navbars section from the onet.xml.
Category : SharePoint