0

Is it possible for each user in SharePoint to customize the theme that appears for them whenever they log in? So if the user A would like the theme to be red instead of blue, they set it to red and whenever they log on they see the red theme, but user B still sees the blue theme when they log in.

Is this doable?

Thanks,

2 Answers 2

0

Answer could be found here. Taken from this site: "Have a web part with personalized storage and have each person modify that web part and choose their theme there. The web part would then change the theme when the person loaded the page."

Similar questions are here and here. There, proposed answers were to create separate CSS`s for users and then a new user profile property "CurrentTheme" (Sharepoint Central Administration -> Shared services -> User profiles and properties -> Add profile property) which was defined as string with a pre-defined list of choices.

You can find the code for this on these sites.

0
0

Disclaimer: this is based on my personal suppositions, so take it with a grain of salt.

I used this post blog as a reference - link here.

You didn't specify which SharePoint version you are using, so let's compare how themes work on SharePoint 2007 and 2010.

SP2007

On SharePoint 2007 theming is achieved by switching the url sof the stylesheets registrations on the page. As the linked page shows, this means that for example the link:

<link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/themeable/search.css ........"/>

becomes:

<link rel="stylesheet" type="text/css"  ref="/_themes/32/search.......css.... "/>

Since you are just pointing to a different url for an existing css file, that would mean that you can calculate the stylesheets urls a given theme would produce, and then simulate the application of the theme by switching them into the page output (like another answer suggested).

SP2010 The main problem here is that SharePoint generates the stylesheet files on the fly. Quoted from the reference article:

When a Theme is applied, SharePoint auto-generates the CSS and Images for the Theme on-the-fly, and stores them in the _themes folder of the site the theme has been applied to.

Based on my understanding, this means that in any given moment you only have a set of valid "css" files: the one globally in use by the site.

Given that, I would go for a hybrid approach. Create a copy of the set of themes you want to give to your users, deploy them somewhere and then reference this copy: that way you will always have a set of valid files.

The main problem you will need to handle is avoiding your stylesheet links begin rewritten by SharePoint when a theme is selected in the site collection / web site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.