EBE: How to deploy a custom theme with a feature...?

Topics: Enhanced Blog Edition
Sep 25, 2008 at 10:51 AM
Edited Sep 25, 2008 at 10:55 AM
Hi,

I got the following error, when I deployed my custom theme with a feature.


Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Value cannot be null.
Parameter name: value

Source Error:

[No relevant source lines]

Source File: /My Blog/themes/MyTheme/theme.master    Line: 1 

 

A problem with the master page.
My elements file in my feature:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Files" Url="themes/e-office2" Path="files" RootWebOnly="False">
    <File Url="theme.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE"></File>
    ..........
    </File>
</Module>


After opening the theme.master in SharePointDesigner and saving it again, the masterpage works fine.
Opening the masterpage in SD makes it unghosted.

My conclusion:
It is not possible to deploy theme.master with a feature (elements>module>file) and have it ghosted.

Is my conclusion right?

Is it possible to depeloy the custom theme with a feature?



Sep 25, 2008 at 12:32 PM
Edited Sep 25, 2008 at 12:34 PM
the answer..

Include the CKS.EBE.ThemeFeatureReceiver in the feature, this eventhandler will deploy the master page.

<Feature  Id="5F633C35-2CFA-4be5-AE17-1BA2D6F6D145"
          Title="My Custom Theme"
          Description="My Custom Theme"
          Version="1.0.0.0"
          Scope="Web"
          Hidden="False"
          ReceiverAssembly="CKS.EBE, Version=0.1.0.0, Culture=neutral, PublicKeyToken=3e8b700c069fb747"
          ReceiverClass="CKS.EBE.ThemeFeatureReceiver"
          xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
        <ElementManifest Location="elements.xml"/>
    </ElementManifests>
</Feature>


For an example see the CKS EBE Themes feature. Keep the same folder structure in the feature like  MyFeature/Themes/<MyTheme>/*.master



Developer
Oct 13, 2008 at 10:44 PM
Try editing the master page in SPD and saving it.

--Vince