Sunday, February 3, 2019

Hide Site Designs menu entry from all SharePoint sites


Office 365 has been growing with strong dynamics. Features have been constantly released in the last years. On the one hand, customers have the opportunity to optimize their way to work. On the other hand, it has become very challenging to keep up to date on the Office 365 improvements and sometimes one just wants to wait until released features are "mature" to work with.

Site Design is a powerful SharePoint functionality which helps administrators provision site structure based on a schema definition. Since December 2018 certain users have been able to access the Site Design information panel through the settings menu of a site collection, enabling them to view applied Site Designs and to apply new Site Designs (Depends on the Site Designs configuration).

At the time of this writing, there is no way to disable the Site Designs functionality from SharePoint or even remove the Site Designs menu entry from the site settings menu via configuration. So, if the company's strategy is just to apply structural changes to a site using a custom provision software or if you don't want to use Site Designs through the settings menu, you need a custom solution to remove that. For that reason I've created a SharePoint Framework Extension which hides the Site Designs menu entry of all SharePoint site collections. In this blogpost, I'll explain which users are able to see this menu entry and how to work with the SPFx Extension.

Topics

  1. Who can access the Site Designs information panel?
  2. How to work with the SPFx Extension

1. Who can access the Site Designs information panel?

The table below lists the SharePoint users who are able to access the Site Designs information panel using the menu entry from the settings menu.

 Users
 Has permission?
 Site Collection Administrators
 
 Site Owners
 ☐
 Site Members
 ☐
 Site Visitors
 ☐

As you can see above, the information panel's visibility is limited to site collection administrators only.

2. How to work with the SPFx Extension

I developed a SPFx Extension which can apply across all site collections and uses CSS to hide the Site Designs menu entry from the settings menu. At first sight the extension removes the entry but site collection administrators could still change the CSS configuration done by the extension and have access to the information panel. The extension only hides the entry from the settings menu!

The SPFx Extension must be uploaded to the SharePoint app catalog. Check the box "Make this solution available to all sites in the organization" if the extension should automatically be enabled across all sites. After trusting the extension, the Site Designs menu entry will be hidden from all sites. The picture below shows the trust dialog:


If the company's strategy has changed and you no longer need these extension, you can either disable it in the Tenant Wide Extensions list in the app catalog or remove it from the app catalog. The picture below shows how to disable the extension:


UPDATE 23.02.2019: It happend! Microsoft has released a new design for the settings menu. It means that my old hack for removing the Site Designs entry no longer works with this new design. What can we learn from it? Consider using SPFx Extensions with the supported and reliable placeholders (e.g. Bottom and Top) instead of hacking the SharePoint site. In any event, I changed my extension so it supports both the new and the old settings menu. If you haven't seen the new design yet, here is what it looks like:


UPDATE 19.04.2019: Microsoft did it again. Well there isn't any new design for the settings menu, but they changed the Site designs' CSS id selector. Therefore, my old hack isn't working anymore. This blog post has become a good documentation about things that can go wrong if you use SPFx Extensions to hack SharePoint. I fixed it again :) Let's see how long it works now! 

Download the SPFx Extension which can hide the Site Designs menu entry from all SharePoint sites!

Important: Consider trying the SPFx solution in a test environment before using it in a production system. Since I don't support problems with the extension, I've published the main code on GitHub. This extension can stop working at anytime because I've worked here with the Site Designs element ID which might look different tomorrow.

Summary


Site Designs is cool :) Give it a try if you haven't tried it yet. Use SPFx Extensions to customize the SharePoint user experience depending on your needs.

No comments:

Post a Comment