Variations and Branding

In SharePoint 2013 a css field can be included in the master page file by adding the following line:

<!–SPM:<SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/_layouts/15/1033/STYLES/Branding2013/Styles.css?ver=0.1 %>” runat=”server” after=”corev15.css”/>–>

This however doesn’t work for variations enabled sites. My site has multiple languages. One of them being Arabic.

The Solution

To make this work for variations use the following line instead:

<!–SPM:<SharePoint:CssRegistration Name=”Branding2013/Styles.css?ver=0.1″ runat=”server” />–>

SharePoint looks by default in the following path :~sitecollection/_layouts/15/1033/STYLES therefore my Branding2013 folder is found in each of the locale folders ( e.g. 1033) Do make sure that you deploy a css for each of the variations used.

To make sure that you only need to maintain one css file for all the variations and only the exceptions in the 1164 ( Arabic) folder it’s bets to include both of the pieces of code:

<!–SPM:<SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/_layouts/15/1033/STYLES/Branding2013/Styles.css?ver=0.1 %>” runat=”server” after=”corev15.css”/>–>

<!–SPM:<SharePoint:CssRegistration Name=”Branding2013/Styles.css?ver=0.1″ runat=”server” />–>

Now does the 1164 version only need the minimum amount of css as all the code is first picked up fro the 1033 version of the css file.

Advertisements