When trying to theme a site, I ran first added a block--menu.tpl.php to style all my menu blocks the same way. Then I added a block--menu--menu-name.tpl.php file for one specific menu. But, that didn't work.

After inspecting the theme_hook_suggestions more closely, it appears that what I needed to add was a block--system--menu-name.tpl.php file. But how would anyone ever guess that? Can we please name these things in a way that people can figure out without having to read documentation or grope around inside complex data objects?

see #1445598: Move menu blocks into menu module (out of system.module)

Comments

jenlampton’s picture

Issue summary: View changes

clean up

cweagans’s picture

Issue tags: +Needs backport to D7
cweagans’s picture

Issue summary: View changes

add link to other issue

jp.stacey’s picture

Is the relevance to #1445598: Move menu blocks into menu module (out of system.module) sufficient to mark this bug as a duplicate of it, and have the rest of the discussion over there?

Theme template names are often not obvious, but it sounds like - if the menu blocks are moved into menu.module - then @jenlampton would've correctly guessed the name with block--menu--menu-name.tpl.php

star-szr’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
Related issues: +#1445598: Move menu blocks into menu module (out of system.module)

The current template suggestions look a bit like this:

<!-- FILE NAME SUGGESTIONS:
   * block--bartik-main-menu.html.twig
   * block--system-menu-block--main.html.twig
   x block--system-menu-block.html.twig
   * block--system.html.twig
   * block.html.twig
-->

Also we have Twig debug. So I think to make this more intuitive we'd have to move it to menu module like the related issue says. Because the suggestion has been improved IMO and the related issue would make it arguably more intuitive, closing as a duplicate.