Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/localgov-drupal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Clone drupal_container
uses: actions/checkout@v2
with:
Expand Down
19 changes: 17 additions & 2 deletions localgov_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ function localgov_theme_preprocess_field(&$variables) {
function localgov_theme_preprocess_menu(&$variables) {
// Add classes to the relevant menu.
if ($variables['menu_name'] === 'main') {
$variables['attributes']['class'] = ['services-list', 'services-list--multi'];
$variables['attributes']['class'] = [
'services-list',
'services-list--multi',
];
}

if ($variables['menu_name'] === 'business') {
Expand Down Expand Up @@ -135,7 +138,19 @@ function localgov_theme_preprocess_office_hours(&$variables) {
function localgov_theme_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
// Allow page template to be overridden by content type.
if ($hook == 'page' && $node = \Drupal::routeMatch()->getParameter('node')) {
$suggestions[] = 'page__' . $node->bundle();
// For the frontpage, ensure that *page__front* is always the final
// suggestion.
$is_front_page = end($suggestions) === 'page__front';
if ($is_front_page) {
$front_page_tpl_suggestion_key = key($suggestions);
unset($suggestions[$front_page_tpl_suggestion_key]);

$suggestions[] = 'page__' . $node->bundle();
$suggestions[] = 'page__front';
}
else {
$suggestions[] = 'page__' . $node->bundle();
}
}
// Fields to be rendered through the field--clean.html.twig template.
$clean_fields = [
Expand Down