Utility Class In DXPR Builder (Drupal 8)
Option 1: Define classes in a theme
First find your theme's .info.yml file. For example your info file could be at /XAMPP/HTDOCS/example_site/themes/example_theme/example_theme.info.yml
Open the example_theme.info.yml file in a code editor and add your class to the end of the file in the format bellow:
dxpr_builder_classes: dxpr-theme-util-overlay-accent1: 'color overlay: DXPR Accent1' dxpr-theme-util-your-class: 'class label: your class'
Make sure to clear all Drupal caches after updating your theme’s info file. This can be done by pressing on Configuration in the toolbar at the top. Scroll down and look for Performance. When you are on the performance page the option to clear all caches will be there.
Option 2: Define classes in a module
If you do not have a custom module you can do this by creating a new folder and naming it what you want e.g. example_module
The folder will then be placed into the directory modules/example_module
Then two files will be made using a code editor:
example_module.info.yml
example_module.module
Open the example_module.info.yml in a text reader and add the lines
name: Example type: module package: custom core: 8.x
Open your example_module.module file and add classes using the formatting in the function below. In the below example code replace example_module with the name of your module.
/** * Implements hook_dxpr_builder_classes_alter(). */ function example_module_dxpr_builder_classes_alter(&$dxpr_builder_classes) { $dxpr_builder_classes['optgroup-my-group'] = t('My Option Group'); $dxpr_builder_classes['my-class'] = t('My label'); }
Make sure to clear all Drupal caches after updating your theme’s info file. This can be done by pressing on Configuration in the toolbar at the top. Scroll down and look for Performance. When you are on the performance page the option to clear all caches will be there.
Utility Class In DXPR Builder (Drupal 7)
Option 1: Define classes in a theme
First find your theme's .info file. For example your info file could be at /XAMPP/HTDOCS/example_site/sites/all/themes/example_theme/example_theme.info
Open the example_theme.info file in a code editor and add your class to the end of the file in the format bellow:
dxpr_builder_classes[your-class] = Class Label
Make sure to clear all Drupal caches after updating your theme’s info file. This can be done by pressing on Configuration in the toolbar at the top. Scroll down and look for Performance. When you are on the performance page the option to clear all caches will be there.
Option 2: Define classes in a module
If you do not have a custom module you can do this by creating a new folder and naming it what you want e.g. example_module
The folder will then be placed into the directory sites/all/modules/example_module
Then two files will be made using a text reader:
example_module.info
example_module.module
Open the example_module.info in a text reader and add the lines
name = Example description = Example of a module core = 7.x
Open your example_module.module file and add classes using the formatting in the function below. In the below example code replace example_module with the name of your module.
/** * Implements hook_dxpr_builder_classes_alter(). */ function example_module_dxpr_builder_classes_alter(&$dxpr_builder_classes) { $dxpr_builder_classes['optgroup-my-group'] = t('My Option Group'); $dxpr_builder_classes['my-class'] = t('My label'); }
Make sure to clear all Drupal caches after updating your theme’s info file. This can be done by pressing on Configuration in the toolbar at the top. Scroll down and look for Performance. When you are on the performance page the option to clear all caches will be there.