Skip to content
Snippets Groups Projects
Commit 54bfce1e authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4847: updating add classes to all non-node pages so that proper width is displayed

parent 495225c8
No related branches found
No related tags found
2 merge requests!32Tag 1.0.1,!27ISTWCMS-4847: adding preprocess to main content area to add classes for 404...
...@@ -104,10 +104,11 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) { ...@@ -104,10 +104,11 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
if ($region == 'content') { if ($region == 'content') {
// Get the route name. // Get the route name.
$route_name = \Drupal::request()->attributes->get('_route'); $route_match = \Drupal::routeMatch();
// If we are on 404 page add appropriate classes to show proper width. // If we are on not on a node, add appropriate classes to show
if ('system.404' === $route_name) { // proper width.
if ($route_match->getRouteName() !== 'entity.node.canonical') {
$variables['classes'][] = 'layout'; $variables['classes'][] = 'layout';
$variables['classes'][] = 'uw-contained-width'; $variables['classes'][] = 'uw-contained-width';
} }
......
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