Skip to content
Snippets Groups Projects
Commit b021bc19 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-4866: adding logic for layout and non-layout pages to preprocess html

parent 92a15123
No related branches found
No related tags found
1 merge request!50ISTWCMS-4866: adding class to content section so that we can target non layout pages
......@@ -57,6 +57,19 @@ function uw_fdsu_theme_resp_preprocess_html(&$variables) {
break;
}
// Get the current path.
$parts = explode('/', \Drupal::service('path.current')->getPath());
// If the last in the array parts is not layout,
// add a class so that we traget anything but
// the layout pages.
if (end($parts) !== 'layout') {
$variables['attributes']['class'][] = 'not-layout-page';
}
else {
$variables['attributes']['class'][] = 'layout-page';
}
}
/**
......@@ -145,19 +158,6 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
$variables['classes'][] = 'layout';
$variables['classes'][] = 'uw-contained-width';
}
if ($route_name == 'entity.node.canonical') {
// Get the current path.
$parts = explode('/', \Drupal::service('path.current')->getPath());
// If the last in the array parts is not layout,
// add a class so that we traget anything but
// the layout pages.
if (end($parts) !== 'layout') {
$variables['classes'][] = 'not-layout-page';
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment