41

Feature stapling is a technique that allows for a feature to be stapled to a site definition by using a support "stapler" feature that defines which features are attached to which site definition. This allows for a feature to be automatically activated on a site created from a site definition without the need to modify the definition files (onet.xml). This ...


7

Is your production a multi server farm? I think you are facing the following issue: http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx It turns out that VS 2010 internally implements a call to the method ...


5

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....


5

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 ...


4

First of all, Start with a new feature to ensure everything is clean. Also, Please note that the configuration for Blank sites is configured(like below) to ignore any features stapled to the Global site definition.The same is true for some other site definitions as well. <Configuration AllowGlobalFeatureAssociations = "FALSE"...</Configuration> ...


4

Use GLOBAL as TemplateName. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureSiteTemplateAssociation Id="{464b78de-c14e-4c88-bd52-00136fc899f4}" TemplateName="GLOBAL" /> </Elements> See Feature/Site Template Association


3

You should dispose of the SPWeb reference after each feature receiver has executed. public override void FeatureActivated(SPFeatureReceiverProperties properties) { using (SPWeb web = properties.Feature.Parent as SPWeb) { } } Admittedly, feature receivers such as this are one of the few places where you don't "have to" dispose of your SPWeb ...


3

I recommend using a Web Event Receiver to do this, and handle the 'WebProvisioned' method. This can be created as a Site collection scoped feature that will trigger for every sub website that's provisioned.


3

The issue is the lists get created after the feature stapling is called in the Site Collection creation process. The My Site is a new Site Collection, not a new subsite, that's why the event receivers don't fire and the manual activation works. I have used a thread pool solution like the one in the link below to delay the execution until the lists have been ...


3

If you're trying to associate your feature to the MySite, try this, substituting the GUID of the feature you want activated for the Id. This associates the specified feature to the SPSPERS#0 template (MySite). <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureSiteTemplateAssociation ...


3

Technical Details Feature stapling is implemented through a Feature that is specifically designed to staple other Features to one or more site definitions. Feature stapling allows a Feature to be stapled to any new sites created from any site definition or from specific site definitions based on the template name identified in the appropriate WEBTEMP.xml ...


3

Feature stappling simply means having a list of features to activate everytime a certain site definition is used (or in natural language stating "Do activate these features when any of the Site definition ID is created"). Basically there is always a Stappler (the actual feature linking one or more site definion ID with the actual features) and a Staplee (...


3

We had the same problem. We had a stapling feature that was applying branding to my personal sites. Staplers code ran, but MDS was still active. What we did, was to add a custom control to a personal site master page which deactivated MDS when site was loaded. In this custom control we added if/else check if this code ran once ( by putting value to web....


3

If I remember correctly the flow is: Site Collection Scoped Features Web Scoped Features Lists Modules Your stapled features would be shot in after Site collection scoped features or Web scoped features (depending on scope) and hence the lists is not guaranteed to be created before the lists. Found a source here: http://blogs.msdn.com/b/chrischiaro/...


3

Based on your comment, create a separate feature for page provisioning and add it in FeatureSiteTemplateAssociation after the lists are created and put the feature which adds XsltListViewWebPart third in the order. So by the time the code in feature activated event of third feature is called both Lists and Pages will be available.


3

I found the solution. Forgot to publish the content type and run the timer job (content type hub & subscriber). After that everything worked! I don't have to run the timerjobs in the feature (code), it works without it!


2

Depending on how you configured your staples you might want to consider attaching it to the Blog Site template too (most likely you attached it to SPSPERS#0). You would need to target the template BLOG#0 also. Simply add another line to your stapling feature as follows <FeatureSiteTemplateAssociation Id="<GUID OF FEATURE HERE>" TemplateName="BLOG#...


2

Can you apply your theme via the UI? Is your feature activated/deployed on your blog? The .master needs to be in the blog web in under _catalogs/masterpage. Also make sure you configured your FeatureStapling correct - Blog is not the same site template as the other sites. Here's a example: <?xml version="1.0" encoding="utf-8"?> <Elements ...


2

There is n o restriction as such that both the features should be in same project. It is always good practice to keep a separate project for site columns/content types/List & Libraries.Below are the points to be kept in mind while creating feature stapling: Staplee feature should be having higher scope than stapled feature. eg: if stapled feature is ...


2

By looking into your code, i think the problem is item.Delete(); item.Update(); You are updating item after you are deleting, there is no need to update the item after delete. You can not update a deleted item.


2

I also faced the same issue. Please make sure that the feature id that you have mentioned in feature stapler must be exactly same as feature id by which you are deploying your event receiver. Please check the below post "http://weblogs.asp.net/sreejukg/apply-custom-theme-to-sharepoint-2013-mysite-using-feature-stapling" Point to be noticed in the above ...


2

We had the same problem couple of months ago, after digging too much we open a MSFT case. Here how we solve it. After updating the wsp, we check if new dll deployed. We also check if updated DLL loaded Recycle the SharePoint timer services on all servers. We use the decompiler tool to find which assembly loaded. In our case, even after updating( many time ...


2

you have to give correct feature id. i had the same problem when i referred that post and almost worked for 2 days. now that you have already deployed, now even if you change feature id, it will not work properly. Now do the fresh project and provide correct feature id.


2

I can suggest you two blogs which I just read because I was planning to do the same as you are. What is feature stapling and how to achieve it here. How to create a list with data whenever a site is created here. Apart from that feature stapling is quite powerful, whatever can be done through feature object model, i.e. feature activation, deactivation can ...


1

Since you want to apply master page to all sites within a web application and a web application can have several site collections and each site collection can have many sub sites. So, here is how I will go about it. Create a site collection feature which uploads master page to library. Create a web scoped feature (staplee feature). This feature will check ...


1

PowerShell below will update the current farm “MDSFeature” XML to disable for all newly created site collections and child webs. If you need to support IE8 and older browsers this can be helpful. The feature GUID technically remains active but won’t do anything with missing DLL assembly detail. After desktops upgrade (IE11/Win8) then this change can be ...


1

You shouldn't use Site definitions and use Web templates instead, because of future upgrades and the fact that MS no longer support site definitions . In case you have custom features, you could write them at proper places in the onet.xml file. Association of you custom feature to onet.xml can be done easily as you might know from site definition development....


1

Figured this one out as well. I added the code (entire control code) for the navigation bar that is on all other sites to the My Sites as well. I got this from the v4.master masterpage. I then hid the navigation bar that My Sites has in my CSS and styled the new control (the one I added) according to my my other sites. I had to create a sitemap for this ...


1

Treasury_MySites.PrivacyStatement.PrivacyStatement is the WebPart Greg is adding to the default.aspx of the MySites. You should replace that with the WebPart you want to add and then set all the properties to the wanted values.


1

You must create site definition and then add some part of text to onet.xml file look at <SiteFeatures> and <WebFeatures> part : <?xml version="1.0" encoding="utf-8"?> <Project Title="SiteDefinitionTitle" Revision="2" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint"> <NavBars> <NavBar Name="$...


Only top voted, non community-wiki answers of a minimum length are eligible