Add a theme to the Communities configuration file
After defining a custom theme, add it to the Communities configuration file, communities-config.xml.
The list of themes displayed in the theme palette in Communities comes from list of themes defined in the Communities configuration file, communities-config.xml. When you define a new theme, add a corresponding theme entry to the configuration file for it to display in the user interface. The placement of the theme in the configuration file list matches its placement in the Communities theme palette. Typically, you might add new themes to the end of the list, but to make the new theme the default community theme, add it to the beginning of the list. This placement means the theme is used whenever another theme has not been explicitly set.
To add a theme to the Communities configuration file.
- Check out the Communities configuration files:
cd app_server_root/profiles/Dmgr01/bin
./start wsadmin.sh
execfile("communitiesAdmin.py")
CommunitiesConfigService.checkOutConfig("/tmp", "cell_name")To get cell: print AdminControl.getCell()
- Edit communities-config.xml
- Add a new <comm:theme> element to include the properties for the new theme in the list of themes that are already defined in the file:
For example:
<comm:theme> <comm:themeUuid>corporate</comm:themeUuid> <comm:displayNameKey>label.theme.name.corporate</comm:displayNameKey> <comm:isScriptKey>false</comm:isScriptKey> <comm:cssUrl>/themes/corporateTheme/corporateTheme.css</comm:cssUrl> <comm:cssRtlUrl>/themes/corporateTheme/corporateThemeRTL.css</comm:cssRtlUrl> <comm:thumbnailUrl>/images/corporate.png</comm:thumbnailUrl> </comm:theme>where:
- <comm:themeUuid> is the unique identifier of the theme that is stored in the database when the theme is selected. It should not contain spaces or special characters. It must be 36 characters or less.
- <comm:displayNameKey> is the resource key for the display name. For information about how to create property strings for the displayNameKey, see Specify the name of a custom theme.
- <comm:isScriptKey> is set to true when the display name is found in a JavaScript resource file.
- <comm:cssUrl> is the location of the theme stylesheet.
- <comm:cssRtlUrl> is the location of the theme stylesheet for right-to-left languages, such as Arabic and Hebrew.
- <comm:thumbnailUrl> is the location of the thumbnail image displayed in the Theme Palette. The image must be included in...
/customization/communities/images/
Ensure the value specified for themeUuid is in lowercase. Also uuid and cssUrl are dependent on each other.
- Save communities-config.xml.
- After making changes, check the configuration files back in, and we must do so during the same wsadmin session in which you checked them out for the configuration changes to take effect. You must also stop and restart the Communities server. See Applying property changes in Communities for information about how to save and apply the changes.
What to do next
- Test the changes by refreshing the web browser.
- When we are ready to make the custom theme available to others, refer to steps 6-8 of Customize the user interface for information about how to publish the changes and make them permanent.
Parent topic:
Add a custom theme to Communities
Related: