While working on the branding of your SharePoint site using ShortPoint, you encounter instances where theme inheritance does not work properly.
For example, you set the root (parent) site theme according to brand in Theme Builder however its subsite uses a different Primary color.
Root Site Theme | Subsite Theme |
Reason
SharePoint does not have theme inheritance from the root site to its subsite enabled. This is true for both modern communication and team sites.
When ShortPoint is installed on both root and sub sites, the subsite will inherit the theme with some limitations. You may find that some SharePoint colors appear as they are added to the theme by default.
Workaround
There are two options you can take to work around this limitation. The first option is to force subsites to inherit exact themes from the parent site by enabling Publishing Features in SharePoint. The second option is to follow the “flat” SharePoint structure that Microsoft recommends.
Option 1: Enable Publishing Features
SharePoint Publishing Features allows you to set a theme with specific colors, font, and background that can be inherited from the root site to the subsite. This feature is not enabled by default.
Enabling Publishing Features in Team Sites
Follow these steps to enable Publishing Features in Team Sites (Modern and Classic Experience):
Note: You have to be, at least, a Site Collection Administrator to complete this process.
Step 1: Navigate to Site Collection Features
- Open Settings by clicking the cogwheel icon on the SharePoint suite bar.
- Select Site Contents.
- Click the Site Settings button.
- Hit Site Collection Features under Site Collection Administration.
Step 2: Activate Site Collection publishing features
- Scroll down to SharePoint Server Publishing Infrastructure.
- Hit the Activate button.
You know that you have successfully activated this feature if you see the Active status on it.
Step 3: Activate Site Level publishing features
- Go back to the Site Settings page.
- Select Manage site features under Site Actions.
- Scroll down to SharePoint Server Publishing.
- Press the Activate button.
You will also see an Active status on it when activation is completed.
Once completed, all theme options you set in ShortPoint Theme Builder for the root site will be inherited in the subsite.
Enabling Publishing Features in Communication Sites
The Publishing Feature is not readily accessible for communication sites. We will need to use PowerShell to enable it.
Prerequisites:
- You have the appropriate permissions to run Windows PowerShell commands on your SharePoint tenancy.
- You are a Global Administrator or equivalent on your SharePoint tenancy.
Note: After running these commands in PowerShell, you will encounter changes on your site navigation and menus. You will be brought to the classic navigation experience to update and fix your menu settings.
When you are ready, follow these steps:
Step 1: Launch Windows PowerShell
- Search for Windows PowerShell ISE.
- Run it as an administrator.
This will bring up the Windows PowerShell ISE window.
Step 2: Download PnP PowerShell
The PnP Powershell module is needed to run the command to enable publishing features in communication sites. If you do not have installed, you can download it by doing the following:
- Copy the code below
- Paste it on the cursor
- Hit Enter.
# Check if the PnP.PowerShell modle has been installed
Try {
Write-host "Checking if PnP PowerShell Module is Installed..." -f Yellow -NoNewline
$PnPModule = Get-Module PnP.PowerShell
If(!$PnPModule)
{
Write-host "PnP PowerShell module is not installed." -f Green
#Check if script is executed under elevated permissions - Run as Administrator
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Host "Please Run this script in elevated mode (Run as Administrator)! " -NoNewline
Read-Host "Press any key to continue"
Exit
}
Write-host "Installing PnP PowerShell Module..." -f Yellow -NoNewline
Install-Module PnP.PowerShell -Force -Confirm:$False
Write-host "Done!" -f Green
}
Else
{
Write-host "Yes!" -f Green
Write-host "Importing PnP PowerShell Module..." -f Yellow -NoNewline
Import-Module PnP.PowerShell -DisableNameChecking
Write-host "Done!" -f Green
}
}
Catch{
write-host "Error: $($_.Exception.Message)" -foregroundcolor red
}
If you encounter a pop-up window asking to install a NuGet provider, click Yes to install it.
Step 3: Connect and sign in to your SharePoint Admin Portal
- Type this command line on the cursor: Connect-PnpOnline -url https://your-domain-name.sharepoint.com/site/<site-name> -UseWebLogin
Where: your-domain-name is your tenancy's domain name, and site-name is your site's name
- Hit Enter. The Microsoft log-in window will appear.
- Hit Enter.
- Sign-in with your credentials.
You have now successfully connected to the SharePoint Admin Portal within PowerShell.
Step 4: Copy and paste each command line
- Copy these lines of code individually and hit Enter after each one.
Enable-PnPFeature -Identity dffaae84-60ee-413a-9600-1cf431cf0560 -force
Enable-PnPFeature -Identity 22a9ef51-737b-4ff2-9346-694633fe4416 -force
Enable-PnPFeature -Identity f6924d36-2fa8-4f0b-b16d-06b7250180fa -force -Scope site
Enable-PnPFeature -Identity 94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb -force -Scope web
Once all commands are run, you have successfully enabled the publishing feature.
Step 5: Reset to activate theme inheritance
After enabling the publishing feature, you can activate theme inheritance between the root site and its subsites.
- Press the cogwheel icon on the SharePoint suite bar.
- Open Site Contents.
- Click the Site Settings button.
- Go to Master Page under the Look and Feel section.
- Navigate to Theme and enable Reset all subsites to inherit the theme of this site.
You will be redirected to the classic menu configuration. Go ahead and make changes according to your requirements.
Option 2: Plan For A Flat Architecture
This option is good for those who have no subsites or only a few in their intranet architecture. Microsoft does not recommend using subsites. Read about their recommended flat SharePoint information structure.
You can utilize instead Hub sites throughout your tenancy. This inherently features theme inheritance and is easier to manage.
Related articles:
- How to Publish a Theme in All Sites in a Site Collection, and Customize it on a Subsite
- Why does it say that my site inherits the settings from parent?
- Copy Themes from ShortPoint Demos Website