Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Bestway to accomplish

  Asked By: Fredrick    Date: Mar 02    Category: Sharepoint    Views: 1181

It sounds simple.

I have a requirement to add a web part to default page of sites, that are
created by a cutom site definition. (custom site definition is also developed by
our team and is in production). The whole process has to be automated.

I thought about 2 options:

1) Update Site definition to add a webpart in onet.xml.
2) develop a small utility to add web part to default page of already created

Option 2:
1) Develop a Feature with stapler for custom site definition to add web part to
default.aspx page
2) develop a small utility to activate this feature on already created sites.
* Note - if developing as a feature, I would run into problems of site
provisioning order as Features are activated before default.aspx is provisioned.

Can someone advise what could be the best approach to handle this scenario.



1 Answer Found

Answer #1    Answered By: Jerod Carrillo     Answered On: Mar 02

If you are creating the site  definition yourself, then Option 1 is the easiest
way to do it. You just need to add  another entry in the Module section of the
Onet.xml file. You will need to add the webpart  to already created  sites
manually or use a small  utility. I wouldn't try to use a Stapled Featrue for
this. I've seen lots of trouble with timing in the past trying to do this. The
stapled feature  tends to fire before the page  is actually instantiated in the
site (as you noted)

Didn't find what you were looking for? Find more on Bestway to accomplish Or get search suggestion and latest updates.