Creating a subtheme is the way to go if you need more advanced custom styling and templating for your DXPR Drupal websites! It's as easy as subtheming any other theme, follow these easy steps!

 

Use the command line to generate a sub-theme

  1. Open a terminal window
  2. cd into the dxpr_theme folder. This folder should be in docroot/themes/contrib/dxpr_theme
  3. Make sure the scripts are executable on your machine with the following command:
    chmod +x scripts/*
  4. Run the sub-theme command:
    ./scripts/create_subtheme.sh
  5. Follow the instructions from the script

Additional steps to operate the custom theme:

  1. Visit the Appearance administration page on your website and enable your custom theme
  2. From the Appearance page, click the settings link for your custom theme
  3. Save the theme settings form

 

If you made it until here you now have a custom theme that inherits all CSS and theme settings from DXPR theme. If you enable your custom theme and visit its theme settings form you can customize the look and feel of your new custom theme. 


 

Adding custom CSS and Templates

  1. We provided an example CSS file in custom_theme/css/dxpr_theme_subtheme.css that is loaded globally on your website. 
  2. If you wish to add more CSS files to your theme, or to add Javascript files, follow Drupal's theming documentation about CSS and JS assets.
  3. By default your custom CSS files will not be processed by the color module. If you want your CSS files to be modified when changing the color scheme in the theme settings form, you have to add a path to the file in the 'css' array near the bottom of custom_theme/color/color.inc. For more details about how the Color module works see the color module integration documentation.
  4. When creating custom template files, please be aware that you are subtheming both DXPR theme and Bootstrap theme, because DXPR theme is a subtheme of the Bootstrap basetheme. 

 

Additional steps when updating DXPR Theme

Due to how the Drupal color module works, a copy of DXPR Theme css files is included in your sub-theme. This means that every time you update DXPR Theme, you need to copy the CSS files again to your sub-theme by following these steps:

  1. Update DXPR Theme to the latest version
  2. in the dxpr_theme folder copy the directories /css/* to /your_subtheme/css
  3. Save the theme settings form