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

  1. 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

  2. Manually add theme to themes folder in site

  3. 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

  4. Install the theme, drush pm:enable civictheme noting outstanding issues with "The "civictheme_one_column" plugin does not exist" . Set theme as default drush theme:enable civictheme

  5. Clear site cache with drush cr

  6. Browse to Home of site to confirm theme is installed

  7. Browse to Appearance then Settings on CivicTheme 1.7.1

  8. Open Content provisioning. Retain all settings that are checked and click Provision content

  9. Run separate drush cr just in case :)

  10. Browse to Home of site confirm items have been provisioned

  11. Browse to Structure > Menus > Add menu

  12. Provide title for new menu. Click Save. Add links to new menu
  13. Browse to Structure > Block layout
  14. Next to one of Footer middle 1, 2, 3 or 4, select Place block.
  15. Select the new menu. Uncheck Display title. Under HTML and style options, add civictheme_footer into the theme hook suggestion and Save block
  16. 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.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

fionamorrison23’s picture

Version: 1.7.1 » 1.x-dev
richardgaunt’s picture

@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

richardgaunt’s picture

Sorry 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

richardgaunt’s picture

Version: 1.x-dev » 1.12.0
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.