function ViewsUiThemeHooks::preprocessDisplayTabSetting
Prepares variables for Views UI display tab setting templates.
Default template: views-ui-display-tab-setting.html.twig.
Parameters
array $variables: An associative array containing:
- link: The setting's primary link.
- settings_links: An array of links for this setting.
- defaulted: A boolean indicating the setting is in its default state.
- overridden: A boolean indicating the setting has been overridden from the default.
- description: The setting's description.
- description_separator: A boolean indicating a separator colon should be appended to the setting's description.
File
-
core/
modules/ views_ui/ src/ Hook/ ViewsUiThemeHooks.php, line 130
Class
- ViewsUiThemeHooks
- Hook implementations for views_ui.
Namespace
Drupal\views_ui\HookCode
public function preprocessDisplayTabSetting(array &$variables) : void {
// Put the primary link to the left side.
array_unshift($variables['settings_links'], $variables['link']);
if (!empty($variables['overridden'])) {
$variables['attributes']['title'][] = $this->t('Overridden');
}
// Append a colon to the description, if requested.
if ($variables['description'] && $variables['description_separator']) {
$variables['description'] .= $this->t(':');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.