Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to determine if there is any way to automatically deploy a few web parts on the creation of new My Sites pages, but in a manner that doesn't use feature stapling. I know how to feature staple, but if I don't have to create a .wsp just to do this it would be preferable to the client.

Is there any no-code solution to modify the default layout used by a site template? This is a publishing site if that makes a difference.

share|improve this question

3 Answers 3

up vote 5 down vote accepted

As each my "mysite" is a new site collection using a Microsoft Site Definition, there is no no-code solution for automatically adding web parts to a page. (Well there is one no-code solution: Someone could sit in central administration add refresh the list of "mysites" and when he sees a new one he could log in and add the web parts, but I think that after a few days he'll be more than happy to install a wsp instead)

Feature Stapling is definitely the way to go. WebProvisioned will not work as it can only be Site or Site Collection scoped, if it could be WebApplication scoped then it would have been a great solution.

But notice that if what you want is to add web parts to the default page on each My site, then you'll run into the problem that the page isn't created until after your stapled feature has been activated, so you can't just add the webpart in FeatureActivated, the usual trick is to add a delegate control in the stabled feature which will the activate the third feature when shown, remove itself and redirect back to the page.

Another option is to create a new welcome page as described in SP2010 "MySites" – Part Four: My Content

share|improve this answer
    
Thanks for your thorough answer. You always seem to pull through for people on here. –  RJ Cuthbertson Apr 23 '12 at 14:38

rjcup,

Your client is likely not the right entity to ask what solution is best. If you're the developer, then you should know best and if your client doesn't trust your judgement, then your client has a problem much greater than how to get something done. If that client knows more about SharePoint than you do, then you have a quite different problem as well.

The right way to accomplish what you want is with a feature stapler, although there are other options. You'll end up with a WSP though, which is usually the case in anything but the simplest of development projects. If your client can't handle the thought of deploying WSPs then they have to give up on anything but the simplest of customization, and this definitely isn't on the 'simplest' list.

.b

share|improve this answer
    
Believe me, I know. There are more issues with this client than this one, I just wanted to know definitively that this wasn't going to come back and bite me in the @$$ if I told them it wasn't possible via no-code and then there was some trick I'd yet to learn. –  RJ Cuthbertson Apr 23 '12 at 14:39

Have you considered the WebProvisioned event handler or use simply Feature Activation event handler and activate other features. See here http://www.keirgordon.com/post/Programmatically-Activating-SharePoint-Features.aspx.

Hope it helps, C:\Marius

share|improve this answer
    
The client has requested a no-code solution if possible. I'm leaning on the side of "it isn't." –  RJ Cuthbertson Apr 21 '12 at 16:09
    
Indeed, a no-code solution the only alternative you have is creating your own Site Definition, which means a lot of XML. Otherwise, I would say no solution. –  C. Marius - MVP Apr 21 '12 at 16:12

Your Answer

 
discard

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.