Drupal theme
Install CivicTheme
composer require drupal/civictheme
Alternatively, you can download the latest version from Drupal.org and place into the desired location.
v1.11 Bug - Remove examples from civictheme_starter_kit
There is a known bug in CivicTheme 1.11 related to the namespace change that came with converting to Single Directory components.
The existing example components need to be removed so that civictheme sub-themes built with this tool work correctly. We will address this issue in code soon.
As a workaround, please delete the following directories from your new sub-theme manually (unless you have added some code changes):
/components/01-atoms/demo-button
/components/01-atoms/demo-button
/components/03-organisms/header
See the issue at Drupal.org.
Install Contrib modules
CivicTheme has required dependencies on contrib modules and optional dependencies on search_api.
These dependencies need to be downloaded and installed before you are able to install CivicTheme.
GovCMS SaaS specific installation instructions
See Using in GovCMS SaaS for specific GovCMS SaaS instructions.
Usage
CivicTheme can be used as a no-code Drupal theme with some of the configurations done on theme settings page.
Enabling contrib modules
Due to Drupal allowing themes to declare module dependencies, but does not yet allow those modules to be enabled automatically).
The contrib module dependencies need to enabled manually or with an automated script:
Enable required modules only
drush ev "require_once dirname(\Drupal::getContainer()->get('theme_handler')->rebuildThemeData()['civictheme']->getPathname()) . '/theme-settings.provision.inc'; civictheme_enable_modules(FALSE);"
Enable required and optional modules
drush ev "require_once dirname(\Drupal::getContainer()->get('theme_handler')->rebuildThemeData()['civictheme']->getPathname()) . '/theme-settings.provision.inc'; civictheme_enable_modules();"
Clear caches
drush cr
Enable CivicTheme
Enable the theme in UI or with Drush:
drush then civictheme
Provision content
CivicTheme comes with pre-set Block Content blocks configuration. Since Drupal does not support running install hooks in themes, a custom content provisioning script has to be used.
Login to the local instance of your site.
Navigate to
/admin/appearance/settings/<SUBTHEME_MACHINE_NAME>
\

Press "Provision content" button.
Navigate to the homepage and observe that all blocks and menus are present.
Export config for created entities:
ahoy drush cex -y
Depending on your deployment workflow, you may need to repeat this step after deployment to your hosting provider environment.
Setting up a sub-theme
See Sub-theme section to create a sub-theme and use CivicTheme as a base theme.
Last updated
Was this helpful?