First, let's say I have 2 site collections within a single web app at port 80:
- Main Site Collection: /
- Nested Site Collection: /sites/special/
So, let's say I have a module in a site-collection scoped feature, the purpose of which is to add a couple of scripts throughout a site collection (this just as easily could be deployed as scriptlink controls in a custom master page for a site collection, my question still applies):
<CustomAction Id="script1" Location="ScriptLink" ScriptSrc="/Style%20Library/mySolution/custom1.js" />
<CustomAction Id="script2" Location="ScriptLink" ScriptSrc="/_layouts/mySolution/custom2.js" />
Both of the above work fine as long as the feature is being activated in the main 'root' site collection. However, if I only deployed the feature to the secondary 'special' site collection (new isolation boundary, nested URL path), won't the script1 reference break?
The browser would be looking for custom1.js at the following path:
/Style Library/mySolution/custom1.js
when really the file is at
/sites/special/Style Library/mySolution/custom1.js
The second scriptlink always works, since _layouts is global, and thus the browser always finds /_layouts/mySolution/custom2.js no matter which site collection the feature was deployed into.
Correct? I guess I'm just doing a sanity check.
I am tempted by the easy access to scripts I can edit on an ad-hoc basis in the /Style Library/, but, hate the idea that such a feature (as designed above) would only work in root level site collections.