1
  • I'd like to apply a custom master page to a subsite.

  • The intent is simply to attach the jQuery library and a loader script to the master page. I have full control to all subsites.

Strict limitations

  1. SP designer is blocked in my environment
  2. I only have read access to the site collection's master page gallery. I'm not a site collection admin.
  3. The publishing feature isn't active for the site collection, but is active for subsites, including my test site.

Steps Taken

  1. I created a copy of seattle.master from the subsites Master Page Gallery. I added the 2 script lines, and uploaded it back to the subsite Master Page Gallery. (Renamed SeattleV2.aspx).

  2. SeattleV2 isn't one of the drop-downs available on the /_layouts/15/ChangeSiteMasterPage.aspxpage.

  3. I don't have the option to publish a master page; the publish option is greyed out on subsites.

(note: I'm Site Collection Admin of a different collection in the same environment and the publish option is disabled for subsites there as well. It's only active on the root master page gallery).

  1. Directly editing the subsites seattle.master doesn't work even when it set to inherit from it's parent site. It appears to still use a copy of the root Site's seattle.master, instead of the subsites.
  • Uploading masterpage or page layouts to subsite's master page gallery will not work, you will have to upload it to root site's master page library, publish it from there and than it will be available in ChangeSiteMasterPage.aspx – Arsalan Adam Khatri May 18 '17 at 5:49
  • Surely that can't be a restriction? - why would each subsite have it's own masterpage gallery then? – Oxossi May 18 '17 at 6:35
2

If you want to load a couple of JS files

Then forget about injecting stuff in MasterPages and use User Custom Actions

(only been around since 2010):

http://johnliu.net/blog/2015/12/the-safest-future-proof-way-to-brand-your-sharepoint-and-sharepoint-online

And instead of Johns ASPX file,

use a Chrome Extension to just apply content to any SP site

https://github.com/tavikukko/Chrome-SP-Editor

iSPE

  • I researched and tested this. It works brilliantly despite a lack of site collection control. I just have to run it for individual sites I want to control. Thanks! It's way better than the master page edit. – Oxossi May 19 '17 at 16:13
0

You can't publish because you have to activate the Publishing Feature in site collection features. Follow these steps.

  1. Go to Site Settings of root site. Then Go to Site Collection Features

  2. Activate this Feature: SharePoint Server Publishing Infrastructure

  3. Go to the Subsite -> Site Settings -> Site Features

  4. Activate this feature: SharePoint Server Publishing

  5. Then upload your edited master page to Master Page Gallery and use it.

  • Unfortunately this is a restriction I wouldn't be able to get around. Interesting thing is that publishing has never been active on the root site as far as I'm aware - however there are a couple custom master pages on the list. – Oxossi May 18 '17 at 7:26
  • Even if you click on "master page gallery" through Site Settings of Subsites, it will redirect you to root level Gallery. If your intent is just to attach the library and small script then edit the .html file associated with the .master and publish it. ".master" will get regenerated. – harshal gite May 18 '17 at 7:52

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.