There are 2 menu templates that we can rationalise in the Umami theme:

menu--main.html.twig is almost identical to menu.html.twig

If we set line 49 of menu.html.twig in a twig block {% block selector %}, then we can use {% extends ... %} for the menu--main.html.twig file and use the {% block selector %} to set what we need.

I think the other templates should remain as they are.

core/themes/umami/templates/components/navigation/menu--main.html.twig
core/themes/umami/templates/components/navigation/menu.html.twig

Comments

markconroy created an issue. See original summary.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

markconroy’s picture

Component: profile.module » Umami demo

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

markconroy’s picture

Issue summary: View changes
Issue tags: +DrupalEurope, +DrupalEurope2018, +Novice
mradcliffe’s picture

It is a little unclear to me about the expected resolution, @markconroy.

I think that the goal is to reduce duplicate code in core/themes/umami/templates/components/navigation/menu--main.html.twig by making use of Twig extended syntax. And then this would require using the block selector twig syntax to implement the overrides.

melinda_ksz’s picture

Mikael and me are starting to work on this issue at Drupal Europe sprint.

holist’s picture

I am mentoring Melinda and Mikael on this.

mikael_ek’s picture

We tried doing the extend/block solution, but the block would not be replaced when placed inside the macro.

markconroy’s picture

Status: Active » Closed (works as designed)

There was a lot of work done in this today and the conclusion was that we don't think it's possible at the moment.

Marking as closed.