Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Site add customisation - feature stapling ?

  Asked By: Colin    Date: May 24    Category: Sharepoint    Views: 1369

I am trying to find out how I can perform some simple modification to
user input when a user attempts to add a new site in WSS.

Basically, I want to check & modify the title, URL, and selected template
when a user attempts to add a new site.

Since there is no 'siteadded' or 'siteadding' event, I obviously cannot use
it, and in looking how to do this I have come accross several discussions on
'feature stapling' which looks to be how others are achieving this - am I
heading down the wrong path here? Is there a more simplistic way I can check
and edit user input before a new site is provisioned?



2 Answers Found

Answer #1    Answered By: Akshay Gupta     Answered On: May 24

I think you may be on the right track here. Whenever i have needed to run
some code or change some settings after a site  is created i have used a
stapler. Its a bit of a confusing concept at first but to put it simply, you
have one feature  that is know as the stappler that basically "whenever a site
is created with site template  X, enable feature Y". The second feature is
feature Y - the feature that gets enabled when the site is created. If you
just want to run some simple  code, you would have the stapler enable the
staplee feature when the site is created, so you add  the code that you want
to run in the FeatureActivtated event.

One way i have used this alot is to make new sites use the parent sites
master page and css setting as i found it very annoying that this was not set
as default (new sites always use default master page and css).

Answer #2    Answered By: Trinity Scott     Answered On: May 24

What I actually did is wrote a custom .aspx page with the code necessary to
generate a new site, and add  the parent's look and feel.
It may not be the greatest coding technique in the world, but it does work.

Next time, I'm going to go the way of stapling  and see how tough it is to
get that working.

Didn't find what you were looking for? Find more on Site add customisation - feature stapling ? Or get search suggestion and latest updates.