User Custom Actions Config Page
The following is what I consider to be the easiest way to add script to your SharePoint and SharePoint Online
- Add Script ID - this enables PnP SharePoint 2013/2016 Responsive UI to be installed by copying 3 files!
- Dropped /SiteAssets/ in path, this means you can add deep nested paths into other libraries, or even subsites. ~sitecollection/ + url (before was ~sitecollection/SiteAssets/ + url
Why use User Custom Actions?
This is a great technique because it lets you:
- You can add more than 1 CSS file
- Order them the way you want via Sequence
- Does not modify MasterPage
- Works in SharePoint 2010, 2013, 2016 and SharePoint Online
- Only need Site Collection permissions to set up - you don't need to have a Farm Solution or Add-In Model. The permission is only required to set up the ScriptLink.
- The object model provides a way for an administrator to check all the User Custom Actions attached to any site/site collection, so there's a level of oversight available if you want to check if your customizations are ready for migration.
There are various ways to attach a script via User Custom Actions.
- Remote Provisioning (Pattern and Practice) uses it via C# CSOM
- PowerShell remote provisioning
- Farm Solution can invoke the API
- Sandbox Solution can invoke the Client Side Object Model API (*with permission)
- Add-In can invoke the CSOM API as well (with Site Collection - Full Control permission)
The unfortunate part is, there's no UI for a power user to add or view ScriptLinks directly. You need to spin up SharePoint Manager or read/update it via PowerShell.
So what do you have here?
I also brand it to look a bit like SharePoint. Just a bit.
- Drop configure-page.aspx into a SiteAssets or SitePages library.
- Provided you have site collection permissions, it'll list all existing User Custom Actions
Specifying different sequence numbers.
hello.js is sequence 1000. hello1.js is sequence 999.
- SP2013/2016 Responsive-UI and UserCustomActionsConfigPage
- SharePoint 2013/2016 Responsive UI