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

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

ISTWCMS-4847: adding preprocess to main content area to add classes for 404 pages and cleaning up template for main content
parent 43cad19d
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 * @file
* Theme override to display a region. * Theme override to display a region.
* *
* Available variables: * Available variables:
* - content: The content for this region, typically blocks. * - content: The content for this region, typically blocks.
* - attributes: HTML attributes for the region div. * - attributes: HTML attributes for the region div.
* - region: The name of the region variable as defined in the theme's * - region: The name of the region variable as defined in the theme's
* .info.yml file. * .info.yml file.
* *
* @see template_preprocess_region() * @see template_preprocess_region()
*/ */
#} #}
{% embed '@layouts/content/content.twig' with { {% embed '@layouts/content/content.twig' with {
'classes': classes 'classes': classes
}%} }%}
{% block content %} {% block content %}
{{ content }} {{ content }}
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}
...@@ -97,6 +97,21 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) { ...@@ -97,6 +97,21 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
$variables['global_message'] = ['#markup' => trim($global_message)]; $variables['global_message'] = ['#markup' => trim($global_message)];
} }
} }
// ISTWCMS-4847.
// If we are on the main content section, the check if 404 and add
// appropriate classes to display proper width.
if ($region == 'content') {
// Get the route name.
$route_name = \Drupal::request()->attributes->get('_route');
// If we are on 404 page add appropriate classes to show proper width.
if ('system.404' === $route_name) {
$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