Search code examples
sitecoresitecore7web-forms-for-marketersmultisite

WFFM - Is it possible to change the theme per site?


In WFFM, you can create your own theme which is set globally for the site on the Website folder (system/modules/web forms for marketers/Website). I have a custom theme working and my theme is loads correctly when I change the Theme field on the global Website folder. The issue is that I have a multi-site instance and the Theme needs to change based on the site. Currently I created subfolders but the page only reads the theme set on the global Website folder instead of the subfolders.

enter image description here

I haven't run across any documentation on setting up WFFM this way, anyone had any experience with setting up multi-site themes?


Solution

  • You can specify the root form folder in your <site> definition, by default the forms.config file specifies the following, which points to /sitecore/system/Modules/Web Forms for Marketers/Website:

    <sites>
      <site name="website">
        <patch:attribute name="formsRoot">{F1F7AAB6-C8CE-422F-A214-F610C109FA63}</patch:attribute>
      </site>
    </sites>
    

    In a multi-site instance you need to specify the formsRoot attribute for each site:

    <sites>
      <site name="site1" ... formsRoot="/sitecore/system/Modules/Web Forms for Marketers/Website/Website 1" />
      <site name="site2" ... formsRoot="/sitecore/system/Modules/Web Forms for Marketers/Website/Website 2" />
    </sites>
    

    The path should work, if it does not then use the Item ID.

    Make sure the folders are of template type /sitecore/templates/Web Forms for Marketers/Forms Folder and you should be able to set the Theme property for each site separately. Take a look at section 2.10 of the Webforms For Marketers Reference Guide.