Problem
When creating a new menu in a site using the base CivicTheme (not a subtheme) and then placing it in one of the Footer menus and looking to apply civictheme_footer in the Theme hook suggestion field under the HTML style and options hides the menu.
Not applying a hook theme suggestion or something that doesn't exist, will have the footer show, but isn't rendered in the list of the other footers.
Applying a different theme hook suggestion like civictheme_secondary_navigation or civictheme_secondary_navigation will apply the relevant theme hooks from the site branding set in the site.
Steps to reproduce
-
Install locally GovCMS via https://github.com/govCMS/scaffold and configure site as SaaS. As of time of writing, the GovCMS version is 3.13.0 (Drupal version is 10.2.6) and scaffold is 3.3.0
-
Manually add theme to themes folder in site
-
Enable the required modules via drush
drush pm:enable components inline_form_errors rest field_group layout_builder_restrictions linkit menu_block paragraphs redirect webform -
Install the theme,
drush pm:enable civicthemenoting outstanding issues with "The "civictheme_one_column" plugin does not exist" . Set theme as defaultdrush theme:enable civictheme -
Clear site cache with
drush cr -
Browse to Home of site to confirm theme is installed
-
Browse to Appearance then Settings on CivicTheme 1.7.1
-
Open Content provisioning. Retain all settings that are checked and click Provision content
-
Run separate
drush crjust in case :) -
Browse to Home of site confirm items have been provisioned
-
Browse to Structure > Menus > Add menu
- Provide title for new menu. Click Save. Add links to new menu
- Browse to Structure > Block layout
- Next to one of Footer middle 1, 2, 3 or 4, select Place block.
- Select the new menu. Uncheck Display title. Under HTML and style options, add civictheme_footer into the theme hook suggestion and Save block
- Browse to Home or a created page to view the footer. The menu is not displayed.
You can adjust the theme hook suggestion to civictheme_secondary_navigation or civictheme_secondary_navigation and the relevant theming applied from the navigation for those links will appear with the menu. While it does show that the menu can appear, it doesn't align to the expected layout and colour scheme for the footer.
You can also adjust the menu level for Initial visibility level to 2 which does seem to assist in serving the menu with civictheme_footer as the hook suggestion but that level impacts links displayed depending on depth of pages within the site and isn't ideal for something like a footer.
Comments
Comment #2
fionamorrison23 commentedComment #3
richardgaunt commented@thisisalistairsaccount
We have a long running PR to fix this but there is no easy solution. At the moment, CivicTheme works out which menu to render based on the menu name.
We have not been able to get to a good solution on how to configure within Drupal (within the theme system) a menu block to render a menu with a certain theme.
https://github.com/civictheme/monorepo-drupal/pull/1350
Comment #4
richardgaunt commentedSorry for the slowness as this was difficult to implement from a theme layer and the way CT works.
We released this fix as part of 1.12 update.
We have instructions here on how to use the theme hooks
https://docs.civictheme.io/development/drupal-theme/menus
Comment #5
richardgaunt commented