Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Programmatically selecting theme

$
0
0

Hi,

I'm try to apply certain theme for my sharepoint site using feature receiver. If my theme is missing I'm creating it like this:

SPFile font = site.RootWeb.GetFile("_catalogs/theme/15/SharePointPersonality.spfont");
SPFile palette = site.RootWeb.GetFile("_catalogs/theme/15/palette032.spcolor");

theme = SPTheme.Open("foo", palette, font, null);

So far creating and applying is working fine. The problem is identifying current theme and checking if it's present in theme gallery.

SPWeb contains only single useful theme related property and that is ThemeCssFolderUrl thought I would prefer using theme name. I also tried usingThmxTheme.GetManagedThemes but it's always empty.

Any ideas how to query available themes in SharePoint 2013 and compare with a current theme?



Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>