You are here

function bricks_preprocess_field in Bricks​ 2.x

Same name and namespace in other branches
  1. 8 bricks.module \bricks_preprocess_field()

Prepares variables for `field.html.twig`.

File

./bricks.module, line 19

Code

function bricks_preprocess_field(&$variables) {
  $element = $variables['element'];
  if (substr($element['#formatter'], 0, 7) === 'bricks_') {
    $variables['items'] = [
      [
        'content' => _bricks_nest_items($variables['items']),
      ],
    ];
  }
}