Question

Is it possible to do it?

Or do I need to deploy a new mastepage.

Was it helpful?

Solution

You can using an "AdditionalPageHead" delegate control..

It is explained quite well here

OTHER TIPS

If you're writing the manifest.xml file yourself, use the TemplateFiles element for CSS and JS files. For example:

<TemplateFiles>
  <TemplateFile Location="LAYOUTS\Custom\Company.css" /> 
</TemplateFiles>

However, the easiest way to do it is by using a tool that manages creation of the WSP file for you.

When using WSPBuilder, files under the 12 folder in the WSPBuilder project are automatically placed on the file system in the corresponding location. For example, 12\TEMPLATE\LAYOUTS\Custom\Company.css would be automatically deployed to "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\Custom\Company.css".


To reference the CSS and/or JavaScript from a master page, use _layouts for the file path. This maps to "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS" on the file system.

Based on the example above:

<link rel="stylesheet" type="text/css" href="/_layouts/Custom/Company.css"/>

Grab the SmartTools.jQuerySetup zip file from the SmartTools for SharePoint project here: http://smarttools.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22111

It's a WSP that deploys a feature called jQuery which consists of the jquery file, an aspx control (that references jquery), and a feature that uses the AdditionalPageHead delegate control.

Once the feature is activated you'll have jQuery on every page in the web app without any master page modifications (including application pages).

Alex is right,

in addition, I find using wspbuilder a top addon for building wsp files.

www.codeplex.com/wspbuilder

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top