Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Stapling Features against MySites

  Asked By: Uma    Date: Oct 30    Category: Sharepoint    Views: 1844

We've created a custom feature which sets the theme of a site.

We want to staple this to our MySites template (i.e. "SPSMSITE#0"). We have the
stapling features setup as a Farm-scoped feature and it's activated, but when
our MySites are created the Web-scoped feature doesn't get activated.

We know the Web-scoped feature works, because we can activate it manually after
the MySite is created.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Christina Lewis     Answered On: Oct 30

I haven't messed with features  on My Site, but given that each site  is
actually a site collection, you might be hitting some walls there.

Have you looked at the MySiteCreate project on Codeplex? There might be
something obvious in their code that you would need to add to yours.

www.codeplex.com/.../ProjectReleases.aspx

 
Answer #2    Answered By: Meaghan Webster     Answered On: Oct 30

Confirm by turning on the debugging that feature  activated event is called when
site is provisioned and no exception is raised from the feature activation code.

What are you trying to accomplish using this feature? please be aware of the
site provisioning order, you may be trying to add/update/delete some thing which
has not been provisioned on the site  yet.

e.g I ran into similar issue of adding a webpart on home page when home page is
not yet provisioned.

 
Answer #3    Answered By: Sunny Delacruz     Answered On: Oct 30

I suspect your problem is that features  stapled to a site  definition
normally fire while the new site is being provisioned. This can be a
problem when trying to make changes that can only take place after the site
is completely provisioned. For example, changing a master page usually
doesn't work via a stapled feature  because there is no guarantee that the
master page gallery exists before the feature is activated.

The solution for this is normally to not use feature stapling  for these
kinds of things. Take a look at the following blog post to see how to
automatically have a site do something immediately AFTER its been
provisioned.

blogs.technet.com/.../the-mystery-that-is-spwe
bprovisioningprovider.aspx

 
Answer #4    Answered By: .net Guru     Answered On: Oct 30

we've actually used the same exact DLL (called by web-scoped feature) and
method (farm-scoped stapling  feature to associate theme feature  with a template)
to associate a theme  with our custom  site definitions. We can't get it to work
with MySites.

We'll have to try it with another OOB template  (like Team Site) to see if it
works.

The only real difference I can see that might make a difference is (as Peter
said above) that each MySite gets created  in its own site  collection. Not sure
why that would matter, because it seems like the sc gets created before the site
anyway.

 
Didn't find what you were looking for? Find more on Stapling Features against MySites Or get search suggestion and latest updates.




Tagged: