You are here

function hook_ds_layout_region_alter in Display Suite 8.2

Same name and namespace in other branches
  1. 8.4 ds.api.php \hook_ds_layout_region_alter()
  2. 8.3 ds.api.php \hook_ds_layout_region_alter()
  3. 7.2 ds.api.php \hook_ds_layout_region_alter()
  4. 7 ds.api.php \hook_ds_layout_region_alter()

Alter the region options in the field UI screen.

This function is only called when a layout has been chosen.

Parameters

array $context: A collection of keys for the context. The keys are 'entity_type', 'bundle' and 'view_mode'.

array $region_info: A collection of info for regions. The keys are 'region_options' and 'table_regions'.

1 function implements hook_ds_layout_region_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

ds_extras_ds_layout_region_alter in modules/ds_extras/ds_extras.module
Implements hook_ds_layout_region_alter().
2 invocations of hook_ds_layout_region_alter()
ChangeLayoutForm::buildForm in src/Form/ChangeLayoutForm.php
Form constructor.
ds_field_ui_regions in includes/field_ui.inc
Add Regions to 'Manage fields' or 'Manage display' screen.

File

./ds.api.php, line 102
Hooks provided by Display Suite module.

Code

function hook_ds_layout_region_alter(array $context, array &$region_info) {
  $region_info['region_options']['my_region'] = 'New region';
  $region_info['table_regions']['my_region'] = array(
    'title' => \Drupal\Component\Utility\Html::escape('New region'),
    'message' => t('No fields are displayed in this region'),
  );
}