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.


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. You can contact me using contact@sharepains.com

Related Posts

Leave a Reply

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

Discover more from SharePains

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

Continue reading