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 added some publishing pages after a site was provisioned (using web template, so I am already adding to nav using in onet.xml).

The pages I am creating are in the navbar of the onet.xml. But they get deleted or something because onet.xml runs first and at that time I don't have publishing pages created (It happens a little later). Now how do I programatically add these pages to the existing navbar and make sure they go in the right place?

share|improve this question
What type of navigation provider are you using? Is your site template based on a team type site (including blank site)? Publishing Sites tend to use a different navigation provider to 'normal' sites. – Andy Burns May 20 '11 at 14:55
using onet.xml navbar property to generate. I will then need to make sure the pages are in the right section – Monica Contera May 20 '11 at 18:22
I have 2 headers (Mananger and supervisor). the publishing pages need to go under Manager header (in correct sort order). (both manager and supervisor headers are populated with lists and libs. designed in onet.xml) – Monica Contera May 20 '11 at 18:52
Looks like this guy is adding to nav bar but clearing everything. but my issue is I need to use existing navigator and add to header section called "Manager Nav".… – Monica Contera May 20 '11 at 19:18
@Moni: I have exact same issue that I can use some help. After provisioning a web I need to use existing nav and make sure the publishing pages are in certain headers. Have you figured it out? I hope someone can help both of us. – Roxanne May 20 '11 at 20:02
up vote 1 down vote accepted

If you add code from the example you mention yourself to a web scoped features feature receiver, and make sure that the feature is added after the feature(s) with the module that provisions the publishing pages, you should be in business.

Features provisioned in ONET is executed synchronously, first by site collection then site scope.

share|improve this answer
I guess i will do that. Thank you sir. let me know if you know a good site that good example on nav bar feature. – Roxanne May 21 '11 at 6:11

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.