Skip to content
Snippets Groups Projects
Commit f0468516 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/ISTWCMS-4847-ebremner-404-pages' into '1.0.x'

ISTWCMS-4847: adding preprocess to main content area to add classes for 404...

See merge request !27
parents 43cad19d e619e4d8
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...
{#
/**
* @file
* Theme override to display a region.
*
* Available variables:
* - content: The content for this region, typically blocks.
* - attributes: HTML attributes for the region div.
* - region: The name of the region variable as defined in the theme's
* .info.yml file.
*
* @see template_preprocess_region()
*/
#}
{% embed '@layouts/content/content.twig' with {
'classes': classes
}%}
{% block content %}
{{ content }}
{% endblock %}
{% endembed %}
{#
/**
* @file
* Theme override to display a region.
*
* Available variables:
* - content: The content for this region, typically blocks.
* - attributes: HTML attributes for the region div.
* - region: The name of the region variable as defined in the theme's
* .info.yml file.
*
* @see template_preprocess_region()
*/
#}
{% embed '@layouts/content/content.twig' with {
'classes': classes
}%}
{% block content %}
{{ content }}
{% endblock %}
{% endembed %}
......@@ -97,6 +97,28 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
$variables['global_message'] = ['#markup' => trim($global_message)];
}
}
// ISTWCMS-4847.
// If we are on the main content section, the check if not a node and add
// appropriate classes to display proper width.
if ($region == 'content') {
// Get the route name.
$route_match = \Drupal::routeMatch();
// If we are on not on a node, add appropriate classes to show
// proper width.
$route_name = $route_match->getRouteName();
$exemptions = [
'entity.node.canonical',
'entity.node.latest_version',
'layout_builder.overrides.node.view',
];
if (!in_array($route_name, $exemptions)) {
$variables['classes'][] = 'layout';
$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