Monday, February 13, 2012

Relative Links

If you have stored your CSS and JavaScript within the physical file directory situated in the 14 hive folder, or in a static place as in the Style Library in the root, you will need to modify the above example to the following:
<!-- CSS -->
<SharePoint:CSSRegistration Name="<% $SPUrl:~SiteCollection/Style Library/CSS/Style.css%>" runat="server"/>

<!-- JavaScript -->
<SharePoint:ScriptLink ID="ScriptLink1" Name="<% $SPUrl:~SiteCollection/Style Library/Script/Script.js%>" runat="server"/>
This code is useful using content deployment for example.

No comments:

Post a Comment