
| Current Path : /var/www/html/vendor/chi-teck/drupal-code-generator/templates/plugin/views/style/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/vendor/chi-teck/drupal-code-generator/templates/plugin/views/style/preprocess.twig |
use Drupal\Core\Template\Attribute;
/**
* Prepares variables for views-style-{{ plugin_id|u2h }}.html.twig template.
*/
function template_preprocess_views_style_{{ plugin_id }}(&$variables) {
$view = $variables['view'];
$options = $view->style_plugin->options;
{% if configurable %}
// Fetch wrapper classes from handler options.
if ($options['wrapper_class']) {
$variables['attributes']['class'] = explode(' ', $options['wrapper_class']);
}
{% endif %}
$variables['default_row_class'] = $options['default_row_class'];
foreach ($variables['rows'] as $id => $row) {
$variables['rows'][$id] = [];
$variables['rows'][$id]['content'] = $row;
$variables['rows'][$id]['attributes'] = new Attribute();
if ($row_class = $view->style_plugin->getRowClass($id)) {
$variables['rows'][$id]['attributes']->addClass($row_class);
}
}
}