SharePoint online vs 2016 – Composed looks.

With the latest releases of PnP PowerShell in SharePoint 2016 I’ve tried exporting sites ( Get-PnPProvisioningTemplate) and then apply the template to another site Get-PnPProvisioningTemplate.  When I do this I noticed that the colours configured within “Site Settings – > Change the look” are being ignored.

I’m quite sure in the past the .spcolor files were exported with the templates.

When I look in the template file I see:

<pnp:ComposedLook Name="" ColorFile="" FontFile="" BackgroundFile="" Version="0" />

It looks like the Composed Look is being ignored.

When I ran this through the debugger I found that the theme doesn’t have a name, and I first thought that this might be the problem.

I then tried using a Publishing site collection in Office 365 and the name of the Theme is now set:

This looks like a bug to me where the name of the theme isn’t always set. Looking deeper into the code I found that the Theme URL is used to match the Current composed to identify which composed look was selected.

Then when I compared how things work in SharePoint 2016 with SharePoint Online I found the answer.

When I look at the composed looks in Office 365 the Current composed look seems to be linked to the selected composed look. For both the Current and Blossom (my source composed look), palette002 is being used.

Within SharePoint 2016 it looks like the Current composed look is a copy of the composed look with its own .spcolor file:

This now means that the code in PnP cannot find what the source of the Current composed look is.

How to get around the problem?

First create a new composed look, then set this to your current composed look. You should now have something like this:

SharePoint online vs 2016 - Composed looks.

Now PnP PowerShell is able to match things up and the colour scheme is now included in your template.

See also:

https://techcommunity.microsoft.com/t5/SharePoint-Developer/PnP-templates-lose-colours/td-p/145411


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. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@sharepains.com

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. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ 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