You are here

function hook_ds_pre_render_alter in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 ds.api.php \hook_ds_pre_render_alter()
  2. 8.2 ds.api.php \hook_ds_pre_render_alter()
  3. 7.2 ds.api.php \hook_ds_pre_render_alter()

Alter the layout render array.

Parameters

array $layout_render_array: The render array.

array $context: An array with the context that is being rendered. Available keys are:

  • entity
  • entity_type
  • bundle
  • view_mode

array $vars: All variables available for render. You can use this to add css classes.

1 function implements hook_ds_pre_render_alter()

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

ds_test_ds_pre_render_alter in tests/modules/ds_test/ds_test.module
Implements hook_ds_pre_render_alter().
1 invocation of hook_ds_pre_render_alter()
ds_preprocess_ds_layout in ./ds.module
Process layout.

File

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

Code

function hook_ds_pre_render_alter(array &$layout_render_array, array $context, array &$vars) {
  $layout_render_array['left'][] = [
    '#markup' => 'cool!',
    '#weight' => 20,
  ];
  $vars['attributes']['class'][] = 'custom';
}