Skip to content

Commit

Permalink
Rename is_page_layout to has_page_layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
kybersoft committed Nov 12, 2018
1 parent 192477b commit 94c4e65
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions assets/scss/layouts/_content-layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
}

// Add space above footer region for all pages except the ones using GovCMS8 Layouts page layout.
.au-body:not(.is-page-layout) {
.au-body:not(.has-page-layout) {
.au-footer {
@include AU-space(margin-top, 2unit);
}
}

// Add space below content region for all pages using GovCMS8 Layouts page layout except the edgy.
.au-body.is-page-layout .page-layout:not(.page-layout--edgy) {
.au-body.has-page-layout .page-layout:not(.page-layout--edgy) {
@include AU-space(margin-bottom, 2unit);
}

Expand Down
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions govcms8_uikit_starter.theme
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function govcms8_uikit_starter_preprocess_page(&$variables) {
govcms8_uikit_starter_theme_settings_mappings($variables, $theme_settings_mappings);

// Set flag saying if current page is using any page layout.
$variables['is_page_layout'] = drupal_static('govcms8_layouts_page', FALSE);
$variables['has_page_layout'] = drupal_static('govcms8_layouts_page', FALSE);
}

/**
Expand All @@ -109,7 +109,7 @@ function govcms8_uikit_starter_preprocess_layout(&$variables) {
$layout = $variables['layout'];
// Only if current layout is inside "GovCMS8 Layouts" module.
if ($layout->getProvider() === 'govcms8_layouts') {
// Set "is_page_layout" flag into static variable storage.
// Set "has_page_layout" flag into static variable storage.
if (substr($layout->id(), 0, 5) === 'page_') {
drupal_static('govcms8_layouts_page', TRUE);
}
Expand Down
6 changes: 3 additions & 3 deletions templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'au-grid',
'layout-container',
theme__highlighted_layouts ? theme__highlighted_layouts,
is_page_layout ? 'is-page-layout',
has_page_layout ? 'has-page-layout',
]
%}

Expand All @@ -71,7 +71,7 @@
{% endif %}

{# Page title and breadcrumbs for all pages except the ones using GovCMS8 Layouts page layout. #}
{% if not is_page_layout %}
{% if not has_page_layout %}
{% if page.content_top|render|striptags|trim is not empty %}
<div class="content-top">
<div class="container">
Expand All @@ -86,7 +86,7 @@
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}

{# Template for node pages using GovCMS8 Layouts page layout. #}
{% if is_page_layout %}
{% if has_page_layout %}
<div class="main-content">
{{ page.content }}
</div>{# /.layout-content #}
Expand Down

0 comments on commit 94c4e65

Please sign in to comment.