1

What's best practice to add stylesheet / js / images / files in the design manager?

What I have done:

  • exported pretty mutch a standard design manager package from sharepoint (wsp)
  • imported it into Visual studio 2012

One way I was thinking of was to add a mapped layouts folder and put all the files there in different folders (js / stylesheet ..) ? How can I refer to those files? Do I need to add those into a element.xml file as well to get the files deployed?

enter image description here

1 Answer 1

3
  • Add New Item and add Sharepoint/Office Module type in project

  • Add the Folders and Files to the Module

  • In the elements file use this format:-

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="Scripts" Url="Style Library/Scripts">
    <File Path="DataTableAssets\Scripts\jquery.js" Url="jquery.js" Type="GhostableInLibrary" />
    </Module>
    <Module Name="Styles" Url="Style Library/Styles">
    <File Path="DataTableAssets\Styles\datatable.css" Url="datatable.css" Type="GhostableInLibrary" />
    </Module>
    </Elements>
    
2
  • how do I refer to files inside a module? I need to refer to those files from ex masterpage, pagelayouts... etc
    – Plexus81
    Sep 4, 2013 at 7:38
  • 1
    Like so:- <SharePoint:ScriptLink ID="ScriptLink1" Name="~SiteCollection/Style Library/Scripts/jquery.js" runat="server" /> Sep 13, 2013 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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