Thursday, June 15, 2017

How to remove the banner on modern pages from the UI

I have previously written about how to change the layout type of a modern page using PnP PowerShell in order to get rid of the huuuuge top banner. Yes,  I know Microsoft is in the works of adding functionality to the UI to allow header changes, but until that happens I figured I’d show a way to accomplish the same for a Power User.

The layout of a modern page is handled by a column named Page Layout Type (PageLayoutType), and it’s part of a sealed content type named Site Page.

You cannot modify a sealed content, and the Page Layout Type column is hidden, so we need a tiny bit of trickery to get this working.

In your site, navigate to site settings, and to site site content types. Or tack /_layouts/15/mngctype.aspx at the end of the URL to go there directly.

Create a new content type named My Site Page which inherits from the Site Page content type.

image

Copy the content type id from the URL in your browser and create the following URL:

https://contoso.sharepoint.com/teams/modernisthenewmodern/_layouts/15/ManageContentTypeField.aspx?ctype=0x0101009D1CB255DA76424F860D91F20E6C411800FA0F5B1F8210094AB33AED9F195597A5&Field=PageLayoutType

On the column screen, make no changes, just hit OK. This will make the column visible later. Next, navigate to the Site Pages library and go to library settings and add the previously created content type.

image

You are now ready to create your site or news page. Once the page is created and saved:

  • navigate back to the site pages library
  • select the page you created
  • click the information icon
  • change the content type to My Site Page

You will now see the Page Layout Type column visible. Change the value from Article to Home, and the banner is gone. You can change the content type back to Site Page after you have changed the layout to ensure any search based experience relying on the base type is still working.

image

Look ma, no banner!

image

Summary

Once set up, you can per page change the content type to your custom one and change the layout to get rid of the banner. It’s somewhat convoluted, but it is doable from the UI :)

No comments:

Post a Comment