Enable and apply a default theme
NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:
$ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."
The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.
edX provides some default themes that you can find in the /opt/bitnami/apps/edx/edx-platform/themes/ directory. To enable and apply a default theme for edX, follow the steps in the sequence shown:
- Enable the theme on edX.
- Apply the theme in the Django administration panel.
- Build assets for the default theme.
Enable a default theme
To enable a default theme, open the LMS and/or Studio CMS configuration files and edit the COMPREHENSIVE_THEME_DIRS and the ENABLE_COMPREHENSIVE_THEMING variables to make them look like this:
NOTE: Depending on your installation type, the LMS and Studio CMS configuration files will be located in the following paths, respectively:
Approach A (Bitnami installations using system packages): /opt/bitnami/edx/etc/lms.yml and /opt/bitnami/edx/etc/studio.yml.
Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/edx/conf/lms.yml and /opt/bitnami/apps/edx/conf/cms.yml.
COMPREHENSIVE_THEME_DIRS: - /path/to/edx-platform/themes ... ENABLE_COMPREHENSIVE_THEMING: true,
Apply a default theme
Access the Django administration console. Check the Django Admin Console instructions for more information.
Browse to “Theming -> Site themes -> Add site theme”.
From the “Site menu”, select the site you want to apply a theme to.
Enter the identifier of the theme (same as its directory name) and click on “Save”. In the example below, the selected default theme is “red-theme”.
The theme will be enabled for the specified site as it is shown below:
Build assets for a custom theme
Run the following command to update assets:
$ sudo edxapp-update-assets
NOTE: If the previous command throws edxapp-update-assets: command not found, execute the following commands instead:
$ sudo edxapp-update-assets-lms $ sudo edxapp-update-assets-cms
Restart the Apache server:
$ sudo /opt/bitnami/ctlscript.sh restart apache