You are here

function template_preprocess_filter_guidelines in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/filter/filter.module \template_preprocess_filter_guidelines()

Prepares variables for text format guideline templates.

Default template: filter-guidelines.html.twig.

Parameters

array $variables: An associative array containing:

  • format: An object representing a text format.

File

core/modules/filter/filter.module, line 372
Framework for handling the filtering of content.

Code

function template_preprocess_filter_guidelines(&$variables) {
  $format = $variables['format'];
  $variables['tips'] = [
    '#theme' => 'filter_tips',
    '#tips' => _filter_tips($format
      ->id(), FALSE),
  ];

  // Add format id for filter.es6.js.
  $variables['attributes']['data-drupal-format-id'] = $format
    ->id();
}