Block component overrides all template suggestions

Created on 6 December 2024, 3 months ago

I am converting a theme that was made with Radix 4 to 6 because boostrap 4 is EOL and upgrading is non optional at this time. I have carefully followed the migration instructions.

For the life of me I cant seem to get template suggestions to fire any more that are more specific than the block component. I am unsure what I am doing wrong and have spent a while working on this. I have a template file block--swiftype--header-search.html.twig, containing `{% embed 'mytheme:block--swiftype--header-search.html.twig%}`.
my component and related javascript is never picked up.

Twig debugging shows that block.html.twig is currently in use even though a template suggestion for block--swiftype--header-search.html.twig exists. (I do not know why template suggestions show up multiple times).

<!-- FILE NAME SUGGESTIONS:
   ▪️ block--enterprisesearch--header-search.html.twig
   ▪️ block--swiftype--header-search.html.twig
   ▪️ block--swiftype--header-search.html.twig
   ▪️ block--enterprisesearch.html.twig
   ▪️ block--swiftype.html.twig
   ▪️ block--swiftype.html.twig
   ✅ block.html.twig
-->

What am I missing?
Note: I have also tried naming the files block__swiftype__header_search.html.twig, block--enterprisesearch.html.twig and block__enterprisesearch.html.twig

💬 Support request
Status

Active

Version

6.0

Component

Code

Created by

🇺🇸United States cpierce42

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cpierce42
  • 🇺🇸United States danchadwick Boston

    I'm not sure why your template suggestion is not being used. Make sure you've cleared the cache. Your suggestions (may) need to be directly in the /templates directory, not nested in a folder within. I found I had to declare the template in MY_SUBTHEME_theme() using the 'path' array element in order to have one of my templates discovered when placed in a subdirectory within /templates.

    In any case, I don't think this is really a radix issue, but rather relates to the core theme system. Best of luck.

Production build 0.71.5 2024