3

SharePoint 2013/2016 Modern Pages and Libraries are horrible. There I said it. If you have themed and customized sites, the modern page will look and behave so out of place. Has anybody customized Modern pages? Any good guides? I hear you can't even add JavaScript calls. I have offered MS this idea of Page templates with Edit configuration options that allow removal of elements on the page and reuse. Is there a better way to approach customization?

SharePoint User Voices - Collaboration Page templates for Modern Pages

1

You only think they're (modern libraries) horrible because you can't customize them like you want. They have a lot of great functionality built into them that makes file management and usability very easy for the users.

Their guidance is to use Classic library experiences if you don't like the modern experience. This can be done on a list by list basis, or configured in the central admin section of SharePoint Online.

  • Like a Title banner that that takes up 30% of the page? Or navigation with no nesting? Yes I can stay on Classic for now, but for how long? And they are now introducing new web parts like the Power Bi Web part that are only supported in Modern Pages . – Hell.Bent Feb 15 '17 at 13:42
  • They haven't given any timeline, just "Classic is not going away". And to be honest, in the hosted world of SharePoint Online where things rapidly change, a highly branded environment is a waste of money. – Eric Alexander Feb 15 '17 at 13:49
0

Customized Modern Pages? Yes

At one client we installed the TamperMonkey (GreaseMonkey on FF) browser extension

It pulls in scripts from our own CDN so we can inject our UX (all that CSR/JSLink stuff we did in 2013) into any Modern or Classic SPOnline page.

Good approach? Hmm...

Alas no alternative Browser extension for IE and Edge

And like the good old days you need Local Login Scripts to manage those extensions locally

0

Unfortunately as of this moment, you are stuck. The only thing that can work on "Modern" site pages is custom theme.

If your site happens to use a custom theme, then this custom theme will be respected in the "modern" page experience

Customizing "modern" site pages

What it says is that - If you developed your own theme using the SharePoint palette tool and then applied it on the site, then it will be respected.

You can use powershell code below or your CSOM code to ApplyTheme. It will respect the theme color (spcolor) and background image. Powershell is as below:

# Connect to a previously created Modern Site
$cred = Get-Credential
Connect-PnPOnline https://[tenant].sharepoint.com/sites/siteurl -Credentials $cred

# Apply a custom theme to a Modern Site

# First, upload the theme assets
Add-PnPFile -Path .\sppnp.spcolor -Folder SiteAssets
Add-PnPFile -Path .\sppnp-bg.png -Folder SiteAssets

# Second, apply the theme assets to the site
$web = Get-PnPWeb
$palette = $web.ServerRelativeUrl + "/SiteAssets/sppnp.spcolor"
$background = $web.ServerRelativeUrl + "/SiteAssets/sppnp-bg.png"

# We use OOTB CSOM operation for this
$web.ApplyTheme($palette, [NullString]::Value, $background, $true)
$web.Update()
# Set timeout as high as possible and execute
$web.Context.RequestTimeout = [System.Threading.Timeout]::Infinite
$web.Context.ExecuteQuery()

PnP Reference - modern-experience-customizations-customize-sites

What will not work on modern pages till now:

1) Alternative layouts

2) Custom page templates

3) Adding "classic" web parts on "modern" pages

4) Custom CSS via AlternateCSSUrl web property

5) Custom JavaScript embedded via User Custom Actions

6) Custom master pages

So as of this moment, the only way to customizing the modern pages is via themes. Everything else will not work.

  • How can one apply a theme without a background image? I tried using $null, $false or "", but it always returns "Exception calling "ApplyTheme" with "4" argument(s): "The 'backgroundImageUrl' argument is invalid.". – modiX Feb 22 '18 at 14:07
  • background image is a required parameter and hence cant be null or false or empty. However, you can add an empty image here $background = $web.ServerRelativeUrl + "/_layouts/15/images/blank.gif" which doesnt do anything – Gautam Sheth Feb 23 '18 at 7:00
0

There are now additional ways to customize modern pages within SharePoint Online. One of the biggest headaches was definitely the page title region. There are now a few options for configuring the page title with different layouts: Configure the Title Region – SharePoint Modern Pages

There are also ways to confirm the individual zones by adjusting the number of columns or even adding background images to rows to break up some of the white space.

I anticipate more options in the future as Microsoft begins to listen to some of the feedback.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.