diff --git a/templates/regions/region--content.html.twig b/templates/regions/region--content.html.twig index c72534edad0b48e5bfed3d3082925f626ea6400c..d9d6a2ddf5f3dbc06af388fb0070422b26a0bbb7 100644 --- a/templates/regions/region--content.html.twig +++ b/templates/regions/region--content.html.twig @@ -1,23 +1,23 @@ -{# -/** - * @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 %} diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme index 521657203dae8df83e4cfbb1e5d6d44e64fb0b6e..1a3e6b0e174c7de68baf6c71af53db8db020f64d 100644 --- a/uw_fdsu_theme_resp.theme +++ b/uw_fdsu_theme_resp.theme @@ -97,6 +97,21 @@ 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 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'; + } + } } /**