We are using a javascript / CSOM applet stored in a .js file in websiteobjects. Now we want to show the applet in all edit forms of document libraries of the site underneath the metadata.

We don't want to edit the several forms manually because we face 200 libraries.

Where to put it? Master-Page? How and in which section? And how to prevent it being shown in list edit forms?

| improve this question | | | | |

If your script could check that it should run without a performance hit, you could load it as a script link in the site or web. It would run on every page, decide if it's a document library edit form, and then do its thing.

Or yes, you could load it into the master page instead of a script link if you prefer.

| improve this answer | | | | |
  • ok, but about masterpage I've asked "How and in which section?" Your statement that I could put it in there does not help much. – Celophysis Feb 2 '18 at 10:20
  • Anywhere not in a content zone, though from a maintenance perspective I greatly prefer the script link approach. Chrome SP Editor that Danny mentions is great, or if you need/prefer a scriptable approach, check out the Add-PnpJavaScriptLink powershell commandlet: docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/… – Chris Romp Feb 3 '18 at 15:47

For easy WYSIWIG adding of SiteCollection ScriptLinks use the Chrome SP Editor: https://chrome.google.com/webstore/detail/sp-editor/ecblfcmjnbbgaojblcpmjoamegpbodhd?hl=en

| improve this answer | | | | |
  • Chrome SP Editor is a great tool, but this doesn't answer anything about the question. – Chris Romp Feb 3 '18 at 15:38

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.