Skip to content

Commit

Permalink
remove duplicate template_preprocess_layout() call
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Bellwood committed Mar 13, 2020
1 parent 5aa7027 commit 5588c8a
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions govcms8_uikit_starter.theme
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,6 @@ function govcms8_uikit_starter_preprocess_page(&$variables) {
$variables['has_page_layout'] = drupal_static('govcms8_layouts_page', FALSE);
}

/**
* Implements template_preprocess_layout().
*/
function govcms8_uikit_starter_preprocess_layout(&$variables) {
/** @var \Drupal\Core\Layout\LayoutDefinition $layout */
$layout = $variables['layout'];
// Only if current layout is inside "GovCMS8 Layouts" module.
if ($layout->getProvider() === 'govcms8_layouts') {
// Set "has_page_layout" flag into static variable storage.
if (substr($layout->id(), 0, 5) === 'page_') {
drupal_static('govcms8_layouts_page', TRUE);
}
}
}

/**
* Implements hook_form_alter().
*/
Expand Down Expand Up @@ -324,5 +309,12 @@ function govcms8_uikit_starter_preprocess_layout(&$variables) {
// Add au-card--clickable class to Card.
$variables['attributes']['class'][] = 'au-card--clickable';
}
};
// Only if current layout is inside "GovCMS8 Layouts" module.
if ($layout->getProvider() === 'govcms8_layouts') {
// Set "has_page_layout" flag into static variable storage.
if (substr($layout->id(), 0, 5) === 'page_') {
drupal_static('govcms8_layouts_page', TRUE);
}
}
}

0 comments on commit 5588c8a

Please sign in to comment.