SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I am trying to reference my SiteCollection Style Library image directory in a javascript file linked up to a DocumentLibrary Webpart in a subsite.

The current directory I am attempting to do this is

 src="/Style Library/images/'

I believe this should have worked as I replicated the xlsx icon generation by using


Well I just cut and pasted the html src to my Sitecollection webpath and I am able to get the image to show up so currently I am unaware of what the issue is.

share|improve this question

Ahh ha I found out the answer.

The path


point to the host web path of

If you wish to access a sitecollection Style Library then you will need to add that onto the url such as

/Sites/Style library/ ...      

or what ever you have named your site collection. Now the weird thing about this is that the tolken for JSLink you can only use

~controlTemplates ~layouts ~site ~sitecollection

I believe then this means that if you wish to use the JSLink to a javascript file on your host site when you are on a different sitecollection you will have to use the full https:// url path to your javascript file.

Kinda silly but hopefully one day they will give us a token that will allow a quick reference to the host web of your site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.