Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

External CSS file in HTML master page

$
0
0

Dear all

First of all the question: How do I refer my own style sheets (in the Style Library library) in Sharepoint 2013 directly in the master page-html file?

I googled a lot and tried those approaches:

Concerning the design of Sharepoint we used to link our stylesheets in the HTML master page using the$SPUrl token.

This is because we are coding the Design in-house and aim to deploy it (automated or semi-automated) to our client servers – therefore we need to use relative paths.

e.g. (SP2010): <SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/Themable/client/style.css %>" runat="server" After="true"></SharePoint:CssRegistration>

Result:

Sorry, something went wrong

 

So I tried the same approach for SP2013 using the new SP 2013 approach:

<!--SPM:<SharePoint:CssRegistration Name="<% $SPUrl:~SiteCollection/Style Library/Themable/customer/style.css %>" After="corev15.css" runat="server"/>

And dozens of little different path variations (including non-relative paths like:https://myserver/path/to/css/ for testing reasons, just to be sure.)

But it didn’t work.

I also tried to use the regular <link href> tag (this works, but is not relative, so no solution for my issue!) I detected (in my point of view) a weird issue: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/9a77eca4-8d88-479a-8127-6716ed5f7a40/#9a77eca4-8d88-479a-8127-6716ed5f7a40

Any Ideas?


Viewing all articles
Browse latest Browse all 7589

Latest Images

Trending Articles



Latest Images