Recently I was asked to include branding on variation sites.

Branding on Variation sites

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.

Fix the Branding on variation sites

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:

<!-- wp:paragraph -->
<p>&lt;!--SPM:&lt;SharePoint:CssRegistration name="&lt;% $SPUrl:~sitecollection/_layouts/15/1033/STYLES/Branding2013/Styles.css?ver=0.1 %&gt;" runat="server" after="corev15.css"/&gt;--&gt;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>&lt;!--SPM:&lt;SharePoint:CssRegistration Name="Branding2013/Styles.css?ver=0.1" runat="server" /&gt;--&gt;</p>
<!-- /wp:paragraph -->

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.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as a Principal Architect at HybrIT Services Ltd. You can contact me using contact@sharepains.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue Reading

%d bloggers like this: