johnnliu / UserCustomActionsConfigPage

The easiest way to add script to your SharePoint and SharePoint Online
33 stars 22 forks source link

Set script src to the host web #9

Open ciphertxt opened 8 years ago

ciphertxt commented 8 years ago

Set's the script src to the host web by default instead of the site collection. (Issue #8)

johnnliu commented 8 years ago

there's actually an additional place with ~sitecollection to be replaced with ~site to complete this change.

I'm going to take this a step further and let people choose whether to use ~site or ~sitecollection if they choose to in the script-url.

Choosing ~sitecollection and using a folder at the rootweb level is better from the siteadministrator's point of view. But ~site is better if it's a site owner's point of view. I'd like to support both.

ciphertxt commented 8 years ago

Supporting both is great. In many cases they site administrator is also the site owner in many orgs, so providing both gives that flexibility.

Feel free to discard this PR if it needs additional tweaks.

Danny-Engelman commented 8 years ago

I do not know if this is relevant for your tool. There are more ~tokens : https://msdn.microsoft.com/en-us/library/office/jj163816.aspx

ciphertxt commented 8 years ago

I believe what @johnnliu is talking about is effectively replicating a subset of those tokens and replicating that login in the methods that set the scripts. From that list the only 2 that are really needed are ~site and ~sitecollection as this isn't an add-in and the scripts wouldn't be hosted in an app web.