Archive for the 'Branding' Category

Another day, another master page

Well, I’ve just built a lovely little HTTP Module that lets us redirect the application pages for a site or site collection to a new master page. I’m quite pleased, to be honest. Anyway, I noticed that the error pages in the site I was testing on were not using my new master page, so I started to examine this. I found that the error page (_layouts/error.aspx) is busy using simple.master. WTF?

It makes sense, I guess. You do need a master page which doesn’t run in an authenticated context, and a brief check shows that this is the master pages for the out-of-box Forms authentication page.

I decided to check out if there were other master pages in Layouts - and there were. My list of master pages is now:

  1. Default.master - used in normal sites. Often replaced for publishing sites.
  2. MwsDefault.master - use in Meeting Workspaces. Awkward to replace, but can be done through code or SharePoint designer.
  3. Application.master - used in ‘administration’ pages, and sometimes pages such as ‘View all site contents’, Recycle bin, and uploading a file.
  4. Simple.master - used in pages that need to run in an unauthenticated context - such as error pages, or forms authentication pages.
  5. sspadmin.master - seems to be used editing audiences, in excel services configuration, in profile administration, and handful of other places.
  6. layouts.master - no idea what this is for. Can’t find where it is used!
  7. dialog.master - used in the little pop-up dialogs, such as when you’re adding or editing a Hyperlink.
  8. pickerdialog.master - used in pop-up dialogs such as the web part gallery, or selecting users.

The master pages in italics are comparatively easy to replace; the rest are much more difficult. And try as I might, I couldn’t change the master page for Errors in my HTTP Module. I guess what I’ll do is write another one to redirect errors to my own custom-branded error page.

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.

What is MSOLayouts_MakeInvisibleIfEmpty()

I was looking through the code of SharePoint’s Blank Web Part page layout, and I kept finding elements called _invisibleIfEmpty. Now, I’d noticed that some page layouts, such as the Splash page layout had borders on their web part zones which were only shown if the zone contained a web part. I was interested in how this might work. People keep asking for web parts with borders, preferrably ones with rounded corners. Read more »

My Sites links HoverCellActive doesn’t show the top border

This has caught me out three times now - I build style, but the top border for the global links ‘My Links’ link didn’t show:

I checked my style, and there it was. So I tried adding a margin, or padding in the cell that contained it.

Wrong. It needs it’s height to be set to 100%.

.ms-globalbreadcrumb .ms-HoverCellActive,
.ms-globalbreadcrumb .ms-HoverCellInctive,
.ms-globalbreadcrumb .ms-HoverCellActiveDark{
height:100%;
padding-top:1px;
}

Stuff I forgot to style

SharePoint has a lot of page elements, and it’s hard to brand it all without missing things. Lists of Page elements like Heather Solomon’s CSS Reference Chart and her “Oh crap, I missed that” list help, but I still found a few that weren’t mentioned. So, I guess this is my “Thank God my testing found I’d missed that” list:

Advanced Search Page - nice grey.
Creation Information Panel - when you hover over an item on the ‘Create’ page, you’ll see this.
People Search Options - shown dynamically when you click the link.
Gantt views - as used in projects
Repeating Meeting Left Nav
WSS Search results page - just ‘cos you’re using it doesn’t mean it isn’t there - or that it won’t be seen…
The Date Picker - and all the problems inherent in that…

What happens when a Theme is applied?

You can apply themes to sites in SharePoint - but what actually happens when you do? Read more »

Setting up your content types and templates…

I received a good link in one of the comments on the blog, and I thought I’d bump this up - Sensible Document and Template Management.

I’m with Mads on this - to me the killer feature of SharePoint is how it works with Offices, and template functionality is key in that. Demos of document properties, quick parts and then the list columns in Sharepoint have a very high wow-factor (rightly so - I think it’s pretty neat too!)

However, templates are something rarely used in my experience, or not use properly anyway. Often it’s seen as an unnecessary effort, and usually everyone just starts creating their own documents from blank, or deleteing the contents from an existing document and using that one, or copying and pasting across - none of which are pretty scenarios.

Then again, often the guys actually making these templates need a good course of ‘How to use Word’. No so much with Excel - I think that people accept you need a bit of training to use it - but Word seems to be an issue.

Anyway, the point is, do try and plan building templates into your project. And that there is probably a consultancy opportunity in trying to generate these…

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 Read more »

Applying Themes

Themes have a couple of big advantages over Master Pages:

  • Any type of site will let you change the theme.
  • They style the Site Admin pages too.

…but there are some pain points too:

It’s certainly worth considering how your theme will be applied up front - although you could using the Alternate CSS url to ‘apply’ your theme. Personally, I think I like the idea of using a Feature.

Corrupt Breadcrumbs in the in PageAreaTitleFrame

I was tempted to call this “The incredible case of the bust rendering of SharePoint pages”, but it seemed a bit long, to be honest. This is a bit of a detective story (and if I’d the developer who built this in the first place, there’d be a murder) so stick with me… Read more »

Next Page »