
Branding with Custom CSS
217
Deploying Themes Through a Feature
The best practice for deploying branding is through a Feature, which is the recommended approach
when dealing with multiple site collections. All custom les such as themes, master pages, CSS les,
and images can be deployed through a SharePoint solution using Visual Studio 2010 and a module
element.
The following code snippet is an example of a
Feature.xml used for deploying a theme through a
Module feature.
<Feature Id=”28E39FC9-BFE9-4FAE-9E71-C5BFEB818D2E”
Title=”My Custom Theme”
Description=”My Custom Theme”
Version=”1.0.0.0”
Scope=”Site”
Hidden=”FALSE”
DefaultResourceFile=”core”
xmlns=”http://schemas.microsoft.com/sharepoint/“>
<ElementManifests>
<ElementManifest Location=”Elements.xml”/>
</ElementManifests>
</Feature>
ThemeElements.txt
The Elements.xml includes the following:
<?xml version=”1.0” encoding=”utf-8”?>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>
<Module Name=”MyCustomTheme” Url=”_catalogs/theme”
Path=”MyCustomTheme” RootWebOnly=”true”>
<File Url=”MyCustom.thmx” Type=”GhostableInLibrary” Path=”MyCustom.thmx”>
</File> ...