SharePoint Theme Settings page and Enhanced Theming

If you create a site using the Blank template and go to Settings > Site Theme you get a simple page that lets you set your site theme.

If you create a site using the Team Site template and go to Settings > Site Theme, you get a more advanced page.

Both these experiences are supported by the one page (/_layouts/themeweb.aspx). So what gives? Continue reading “SharePoint Theme Settings page and Enhanced Theming”

SharePoint Theme Settings page and Enhanced Theming

Publishing Navigation without the Publishing…

Recently, a few of our customer’s systems that I’ve looked at have had the Publishing Infrastucture site collection feature activated, but purely for the top navigation. That seemed quite a heavyweight approach to me. Continue reading “Publishing Navigation without the Publishing…”

Publishing Navigation without the Publishing…

Automatically add themes to the SPThemes.xml file

I’m not sure I’ll use themes again over the AlternateCssUrl again in a hurry, but I did decide to take a look at the 10 example themes Microsoft Released in March. I’ll blog about how they look – sometime! (The short answer – some good, some bad, some awful!)

Anyway, I was interested that the themes could all be activated as features. This rather kept with my feeling on how branding should be deployed.

However, some of the themes (though not all) were suddenly available in the ‘Site Themes’ page of my SharePoint system. I knew from experience that this isn’t something that ‘just happens’ – previously, I’ve done it by hand.

EDIT: See the comments – they describe an possible pit fall, but both have articles about how to do the same thing… Continue reading “Automatically add themes to the SPThemes.xml file”

Automatically add themes to the SPThemes.xml file

Deploy Publishing Pages and Content Types as a feature

Aka “CAML is the bastard spawn of Satan”.

So, I’m writing a site definition to create a Publishing site. This is a bit of a first for me. One of the things I want to do is deploy a new Publishing Page Content type, and associate some layouts with it.

I started by following Andrew Connell’s instructions for a Minimal Site Definition (as in his book). This all seemed to go pretty well; testing created a new, minimal site.

Next up I wanted to deploy the Content Type and associated page layouts. Well, there wasn’t much information in his book on this – like him, I’d figured I’d write a separate Feature for deploying just the content type and page layouts – but there was very little information in his book about this. Continue reading “Deploy Publishing Pages and Content Types as a feature”

Deploy Publishing Pages and Content Types as a feature

Feature Stapling for Branding

As I’ve mentioned before, I reckon that from now on I’ll do all SharePoint branding through features alone – not using themes or the ‘choose master page’ page. Which is fine, and useful too – one of the questions that has been raised recently is how to automatically apply the branding when a new site is provided. Well, feature stapling is the way to do that.

For those who don’t know, feature stapling is creating a feature which associates another feature with a Site Definition. When a site is provided by that site template the associated feature is activated. So, for example, we might have a BrandingFeature feature, which does all of our setting alternate CSS, setting master pages, etc., and then use a BrandingStapler feature to associate that with some (or all) of our site definitions.

I won’t bother repeating the ‘how to’ of it, as there are plenty of good posts about it.

Feature Stapling for Branding

Where to put CSS when branding?

I’ve recently come to the conclusion that I’m unlikely to use Themes in SharePoint again in a hurry. Why?

  • Themes allow you to provide a bunch of CSS styles. So does the AlternateCssURL.
  • Themes have to be applied site-by-site (unless you do some programming, or extend STSADM). Alternate CSS or Master Pages can be changed for a site and subsites, for a Publishing site anyway (although with some limitations).
  • Alternate CSS can be provisioned from a single URL – so benefiting from browser caching just like images.
  • The Alternate CSS can style the DatePicker. Themes can’t.
  • The Alternate CSS can style Application Pages, just like Themes (but unlike Master Pages).
  • No problems with ‘Style Merging’ when the Theme is provisioned.
  • Style can be updated in one location.
  • Themes can be changed through the UI for any site. Only Publishing sites have a user interface for changing the Alternate CSS.

Yes, many of the same distinctions between Master Pages and Themes still exist, and the same sort of analysis and choice of approach should be done. However, it means that we can kind of ignore Master Pages, and just focus on Alternate CSS vs Themes – and it seems to me that apart from the last point above, the Alternate CSS approach seems to equal or better than Themes.

Regarding the last point, well, to apply my theme I’d set the Alternate CSS in a Feature Receiver. This is okay, though, as I’d probably be writing one anyway to apply the correct master page to different types of site.

So, the answer I’ve come to now – I’d use the _layouts directory – create a sub-directory for your brand, and put your CSS and images in there.

Where to put CSS when branding?

Feature Receiver to apply master pages to normal or meeting sites

As noted previously, Meeting Workspaces use a different master page to the ‘normal’ master pages in SharePoint. This is a little annoying – if I need to apply a new master page, how would I do this?

Well, you can activate a new master page in a Feature Receiver. And we can detect the type of site we’re dealing with. Why not combine the two techniques Continue reading “Feature Receiver to apply master pages to normal or meeting sites”

Feature Receiver to apply master pages to normal or meeting sites