Content Type Hubs and the Blank Site Template – Fixing them

So, I’ve somehow managed to get through most of the SP2010 cycle without having to use the Enterprise Content Type hub – until last week. This was my opportunity to stumble across one of the gotchas of the ECT hub – it doesn’t work with blank sites. We had a number of site collections based on the Blank site template, and content types would not replicated to it. Other site collections based on other templates – such as Team sites – worked fine.

Interesting. And this tickled a neuron. Continue reading “Content Type Hubs and the Blank Site Template – Fixing them”

Advertisements
Content Type Hubs and the Blank Site Template – Fixing them

Annoying Navigation in Search Centers

I had two of my colleagues come to me with the same complaint – that the Basic Search Center site template in SharePoint 2010 doesn’t have any navigation to get ‘back’ to the rest of the site collection:

I pointed out to them that there are good reasons to consider having the Search Center separated from the rest of your content. I’d even suggest a separate Site Collection if using the Enterprise Search Center. (This uses the publishing features, and you might not want them turned on in your existing site collection).

However, my colleagues didn’t need all that, and really did just want a simple search center in the same site collection as their content. For example, a departmental site collection needed its own search center and search experience. But they’d really like users to be able to navigate back to the rest of the site collection.

So, I set forth to fix this dire state of affairs for them. Continue reading “Annoying Navigation in Search Centers”

Annoying Navigation in Search Centers

Site Template Descriptions and Site Descriptions

When you save a Site Template in SharePoint you can specify a Description. That’s fine – but doesn’t really seem to be used anywhere, other than a little note on the ‘Create new Site’ form (see below). I’d always assumed that it was. Well, I was wrong. Continue reading “Site Template Descriptions and Site Descriptions”

Site Template Descriptions and Site Descriptions

System.Web.UI.WebControls.WebParts in ONET.xml

Came a cropper on this one today – using web parts based on System.Web.UI.WebControls.WebParts.WebPart in a Site Definition. Unlike the Microsoft.SharePoint.WebPartPages base web part, ASP.NET 2.0 ones need a <webParts /> tag around your <webPart> tag – other wise you get the error:

Cannot recognize the xml namespace of this web part

Joris Poelmans has a good description of the problem, and that was where I read the solution – it saved me a tonne of time.

System.Web.UI.WebControls.WebParts in ONET.xml

Why I hate (and love) Site Definitions

I love the idea of site definitions. The idea that we can just say ‘give me a site for X’ and in a puff of magic smoke have a site with a feature rich experience just appear – that’s neat! And with SharePoint’s Feature mechanism and object model, we should be able to to a lot with them.

Strangely, after two and a half years working with SharePoint, I’d never built a site definition. (I don’t know how I managed that!) Recently, though, I’ve written several, and all I can say is that I’m older, and greyer than I was before. The reality of Site Definition development did not live up to my hopes. Continue reading “Why I hate (and love) Site Definitions”

Why I hate (and love) Site Definitions

Putting Custom Web Parts in ONET.xml

So yesterday I was trying to add a content editor webpart to a page I was deploying through ONET.XML. I wondered how to add custom web parts, and how you’d know what the XML for them was.

Turns out it isn’t very hard. An example:

<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="SourceCode.Solutions.GenericCaseWebParts.CaseSSRSReportViewer" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="TitleUrl" type="string" />
<property name="TitleIconImageUrl" type="string" />
<property name="ReportServerUrl" type="string">http://vm-moss:8088/ReportServer</property&gt;
<property name="Parameters" type="string">&lt;ReportParameters&gt;&lt;Parameter Name="CaseId" MultiValue="false" Value="[Case Id]" /&gt;&lt;/ReportParameters&gt;</property>
<property name="ChromeState" type="chromestate">Normal</property>
<property name="Title" type="string">Context Info</property>
<property name="ReportPath" type="string">/Reports/Case Details</property>
<!-- Snip -->
</properties>
</data>
</webPart>
</webParts>

As you can see, at the top we define the class to use, then we set various properties (I’ve trimmed that set quite a lot). But how did I get the XML? Well… I set the web part up in SharePoint and exported the web part to a file; this was the XML I needed to put into my ONET.xml. Copy and paste… job done.

Putting Custom Web Parts in ONET.xml