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

Unable to apply custom theme with background Image through code

$
0
0

Hi,
I am creating custom SharePoint 2013 theme and applying it through code on site by referring MSDN Article : "http://msdn.microsoft.com/en-us/library/office/jj927175(v=office.15).aspx".

However when I try to add background image in custom theme and apply that theme to site then sites UI breaks.

Details: I have two features, in feature-1: I am Deploying *.spfont, *.spcolor and background image. Then I am adding a new entry in "composed looks" list for my custom theme. in feature 2- I am applying the custom theme to site by using following code

SPTheme theme = SPTheme.Open("NewTheme", colorPaletteFile, fontSchemeFile, backgroundURI);

theme.ApplyTo(Web, true);

Both feature activates without any errors, new entry also gets added in 'Composed Looks' list with all correct URLs, current item of composed looks list also change to custom theme but entire UI of site breaks

If I remove background Image code from custom theme then everything works fine.

Following code works fine

SPTheme theme = SPTheme.Open("NewTheme", colorPaletteFile, fontSchemeFile);

theme.ApplyTo(Web, true);

If I apply same background Image manually(not through code) then also everything works as expected.

Any help will be really appreciated.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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