Hi all !!
Im in SharePoint 2013 in online version.
I’ve a problem with relative URLs in Content Editor webparts. That content editor is in an aspx page in Pages Library, an my HTML files are in SiteAssets library.Â
All references were load with relative path format, for example:
“../siteAssets/home-file.css”
But my problem is that in excecution time, the reference is without all url:
href=”home-file.css”
Any idea?
Thanks!!!
For the best results, you should specify server relative URL, i.e. /sites/your-site-collection/siteAssets/home-file.css
If you are using loader model (https://github.com/OfficeDev/PnP/blob/master/Samples/Core.EmbedJavaScript/Core.EmbedJavaScriptWeb/Scripts/scenario1.js) you may leverage on _spPageContextInfo object (just do not forget to wrap it around SP.SOD.executeFunc(‘sp.js’, ‘SP.ClientContext’, function () { //your code goes here })