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

Themes in SharePoint 2010

So, followers of this blog will know that I seem to get quite a lot of branding tasks, and that I don’t much like themes, preferring to use either the AlternateCssUrl and Features instead. Features are great – you can deploy the CSS/image files you need, set master pages (and handle Meeting Workspaces), themes, AlternateCssUrls. They can also add HTTP Modules for branding Application Pages.

Themes, on the other hand, are fiddly to install automatically, don’t work on the DatePicker, and are individual to each site once applied. To pick up changes to a global theme, you’d have to apply a different theme and then reapply the desired theme – for every site.

Well, that was with SharePoint 2007. SharePoint 2010 is a bit different, as I got to find out on a Combined Knowledge course in January (and this is the first time I’ve managed to write about it!) Continue reading “Themes in SharePoint 2010”

Themes in SharePoint 2010

Adding CSS links to your SharePoint pages or code…

I love Twitter – you get some though provoking questions on it. Thomas Resing asked the other day:

How are you applying styles to your custom web parts in #SharePoint? using CSSClass property, stuck on deploying css <Link> tag in the head

Well, for pages themselves you have the CSSRegistration control. It’s an ASP.NET control, and looks something like:

<SharePoint:CssRegistration name="/_layouts/myBrand/SomeStyle.css" runat="server"/>

This control registers the URL with the page, but doesn’t emit anything. That’s controlled by the CssLink control:

<Sharepoint:CssLink runat="server" />

It actually outputs the <link> elements, and this means that you can have a CSSRegistration control low down in the page (in a Content control, for example) and you can still output it in the <head> of your page. There’s a good post about this on CleverWorkarounds.

So, could we use that control? Well, we should be able to instantiate one – except it turns out that we don’t have to. We can just use the CSSRegistration.Register() static method – something like:

protected override void CreateChildControls(){
CssRegistration.Register("/_layouts/myBrand/SomeStyle.css");
}

Job done…

Adding CSS links to your SharePoint pages or code…

Rounded Corners on Web Parts

The Holy Grail of SharePoint branding – at least as far as I’m concerned – is rounded corners on Web Parts. Every design that comes in has this at first. As mentioned yesterday there are examples of doing this for the web part’s title – I’ve done this using Madalina’s instructions and Heather Solomon has some instructions too.

However, as far as I know nobody has yet figured out a way of putting rounded corners on the bottom corners of web parts. The HTML they have does not suit them to do this via CSS. The only idea I’ve had previously was to use ControlAdapters to modify the output of of the Web Part itself. And I’m pretty sure you’d have to write an adapter per web parts. That kind of sucks; no customer is going to be in a hurry to pay for that.

Well, when I was looking at putting borders around an entire web part zone, I had a thought. What we really need to do is insert elements into our page. jQuery can do that sort of thing. Could I use jQuery to find each web part and wrap some tags around it? Continue reading “Rounded Corners on Web Parts”

Rounded Corners on Web Parts

Rounded Corners on Web Part Zones

Curiously, one of my more popular blog posts is about putting rounded corners on things in SharePoint. It does seem that this is a pretty popular question. As a side note, Heather Solomon has a post about doing this for web part titles, though I followed Madalina’s instructions.

Anyway, one design requirement that come up repeatedly is rounded borders on Web Parts. I swear, it comes up with every design – and it isn’t possible (although I have an idea – more on that tomorrow). What you can do, though, is have a rounded border about the entire web part zone… Continue reading “Rounded Corners on Web Part Zones”

Rounded Corners on Web Part Zones

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

Putting actions into the PlaceHolderLeftActions

The Wiki and Blog sites have pages that make use of the PlaceHolderLeftActions content placeholder. I’ve mentioned this before regarding putting a web part zone below the quick launch menu. This time I wanted to list some actions for our ‘case’ system.

placeholderleftnavactions

The code to do this? Not very hard. Naturally, we’ll actually have some code to generate our actions and links…

<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
<DIV class="ms-quicklaunchouter">
<DIV class="ms-quickLaunch" style="WIDTH: 100%">
<DIV class="ms-quicklaunchheader">Case Actions</DIV>
<div>
<TABLE class="ms-navitem" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR><TD style="WIDTH: 100%">
<A class="ms-navitem" href="http://vm-moss/Default.aspx">Action 1</A>
</TD></TR></TABLE>
<TABLE class="ms-navitem" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR><TD style="WIDTH: 100%">
<A class="ms-navitem" href="http://vm-moss/Default.aspx">Action 2</A>
</TD></TR></TABLE>
</div>
</DIV>
</DIV>
</asp:Content>

Putting actions into the PlaceHolderLeftActions