function seven_preprocess_html in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/themes/seven/seven.theme \seven_preprocess_html()
Implements hook_preprocess_HOOK() for HTML document templates.
File
- core/
themes/ seven/ seven.theme, line 13 - Functions to support theming in the Seven theme.
Code
function seven_preprocess_html(&$variables) {
// If on a node add or edit page, add a node-layout class.
$path_args = explode('/', \Drupal::request()
->getPathInfo());
if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) {
foreach ($suggestions as $suggestion) {
if ($suggestion === 'page-node-edit' || strpos($suggestion, 'page-node-add') !== FALSE) {
$variables['attributes']['class'][] = 'node-form-layout';
}
}
}
}