Question

My customer wants to provide 2 themes for a SharePoint application. Is there a strategy to accomplish this in MOSS 2007?

We want to apply user profile-based theme selection, and maybe even a drop-down to switch modes.

Was it helpful?

Solution

I don't know how extensive you want your re-theming to be. However if it could be CSS-only you could use this approach:

  1. Store the CSS files for the different themes in the Style Library.

  2. Create a list that stores the user and their chosen theme.

  3. Write a feature and custom application page to allow the user to change their theme.

  4. Write a control that does a lookup on the list against the current user and obtains the a reference to the corresponding CSS file in the Style Library. The control would then output the CssRegistration and CssLink controls to the page for this file.

  5. Add this control to the master page so it executes on every page (caching should be added).

I can't see why this wouldn't be supportable by Microsoft as you're only changing CSS.

If you need to do more than that then another option is to write an HTTP module that changes the HTML output. Or of course JavaScript. With these two options you may have supportability issues (it depends on how extensive your changes are).

OTHER TIPS

There is also SPThemes now available on Codeplex from Bjørn Furuknap. Users can choose their own themes and they can be applied at different scopes.

Here are the options that I’ve come up with from research and feedback. Both of which seem mostly infeasible.

  • Implement major UI layout changes in JavaScript. This would lead to client slowdowns, would be difficult to code, and would be completely unsupported by Microsoft due to the need to reference SharePoint objects that may change with subsequent SharePoint patches.

  • Provide two parallel themed sites based on the same data, and provide a way to switch between them. This would require that we deploy each site to multiple locations, and would require retooling of any site creation mechanisms in code (since they'd need to target two sites instead of one).

One another thing you can try is to use the Theme Changer and ThemeChangerStaple from codeplex , That is implemented as feature you can use the same code logic to archive what you want with bit of modification, give it as an option for the user using CustomAction.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top