Block Templates cannot be inherited by subthemes.

Created on 17 March 2017, almost 8 years ago
Updated 29 January 2024, 11 months ago

Problem/Motivation

During theme initialization, block_theme_initialize() copies over existing blocks and gives them a machine name prefixed with the theme name. This severs the link between the blocks in the subtheme and their twig templates.

Proposed resolution

Given a block named "mysubtheme-myblock" we check the current theme for "block--mysubtheme-myblock.html.twig" as we do currently, then look for "block--myblock.html.twig" in the parent, then resume the current order of possible theme names for a match. This is complicated though by block names containing an underscore or dash. It might be necessary for blocks to be aware of their compliment in the parent theme, if any, if that isn't in place already.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: outdated

Version

11.0 🔥

Component
Theme 

Last updated 2 minutes ago

Created by

🇺🇸United States Aki Tendo

Live updates comments and jobs are added and updated live.
  • theming

    Used in Documentation issues related to theming

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand danielveza Brisbane, AU

    This feels like a feature request - Can we get a list of steps to reproduce?

  • Status changed to Closed: outdated 11 months ago
  • 🇺🇸United States smustgrave

    Doesn't appear to have been any follow up since #17. Going to close out for now, if still a valid request please reopen.

Production build 0.71.5 2024