Some of my colleagues are consultants who go out and try and design or generate SharePoint systems for customers. Naturally, they like to try and start from a blank starting point – so they use the ‘Blank Site’ template. However, they keep having problems with the Managed Metadata columns in such sites – in short, they don’t work.
This is because a Managed Metadata column is actually several columns. When you add one to a list an event handler is run, which adds the additional columns, I believe. However, this event handler isn’t registered on the Blank Site, and you have to turn the Feature which registers it on by hand.
I always thought that this because someone had just overlooked registering the event handler for Blank site templates, but I saw this tweet from Anders Rask:
AndersRask: wondering why TaxonomyFeatureStapler attaches to GLOBAL *and* a bunch of other sites but *not* STS#1 (blank)
Hmm. For a while I’d missed the significance of the GLOBAL bit, and complained that this was forever hampering our consultancy guys. Anders pointed out that it is GLOBAL – the feature should be stapled to ALL site definitions. He was puzzled by the registrations, which said GLOBAL, and then registered individually against all the normal Site Definitions in SharePoint…
<Elements xmlns="<a href="http://schemas.microsoft.com/sharepoint/">http://schemas.microsoft.com/sharepoint/</a>"> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="GLOBAL" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="STS#0" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="STS#2" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="MPS#0" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="MPS#1" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="MPS#2" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="MPS#3" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="MPS#4" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="WIKI#0" /> <FeatureSiteTemplateAssociation Id="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" TemplateName="BLOG#0" /> ... and lots more
Yup, the blank site template (STS#1) was a notable exception from that list – but so what? There is a GLOBAL registration – Anders was rightly puzzled by the dozens of redundant entries below it. I wondered – could the GLOBAL registration not be working? Looking around, plenty of people were using it, so that seemed unlikely.
Then I decided to take a look at the blank site template itself, to see if it is unusual – and it is. I found an attribute AllowGlobalFeatureAssociations=”False” . Well, that’s pretty clear. It won’t allow the GLOBAL registration to work with it. None of the other ‘normal’ site definitions in SharePoint use it (only the Shared Services Admin site definition also uses it).
My theory is that when writing the TaxonomyFeatureStapler someone on the SharePoint dev team realised that the Blank template wasn’t registering the stapled feature. I think they understood why, and decided to staple the feature for the individual Site Definitions instead – hence the entries below. The would register against the Blank site definition. But then came the uncertainty – a Blank site is supposed to be, well, blank. So should they be stapling Features to the blank site template? Maybe, maybe not. Eventually, for whatever reason, someone decided “No”.
It’s a bit of an annoyance. I might look at knocking up a little feature to register the taxonomy stuff on Blank sites too, just to make our lives easier within the company.
Oh, final point, as Anders mentioned to me – this is only a problem if the Blank site is the root site in a new Site Collection. Yup, I’d discovered that one too!
They like to keep us on our toes I think. Another little SharePoint mystery to keep us entertained.
I’ve come across that one myself. I find the easiest thing to do it to use PowerShell to activate the hidden feature:
Enable-SPFeature -Url “http://thesite” -Identity “TaxonomyFieldAdded”
The TaxonomyFieldAdded feature adds the TaxonomyHiddenList and all that good stuff.
Cheers,
Ch.
Hey Charlie!
Yes, that’s a fair point – you can fix it with Powershell or STSADM
STSADM -o activatefeature -name TaxonomyFieldAdded -url “http://thesite”
It’s easy to fix, I was just curious about why we had to!