Theming field template

Created on 14 July 2018, almost 6 years ago
Updated 26 February 2024, 4 months ago

Templates do not work in a theme folder

FILE NAME SUGGESTIONS:
* field--flipbook--flipbook--flipbook.html.twig
* field--flipbook--flipbook.html.twig
* field--flipbook--flipbook.html.twig
* field--flipbook.html.twig
* field--file.html.twig
* field.html.twig
and
flipbook.html.twig

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine proweb.ua

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡©πŸ‡ͺGermany Duwid

    Module alters theme registry to override field-template, instead of implementing custom theme via theme hook. Module should implement its own theme hook.

    Temporary workaround: Override theme registry alter hook with custom path:

    /**
     * Implements hook_theme_registry_alter().
     */
    function my_module_theme_registry_alter(&$theme_registry) {
      $theme_registry['field__flipbook__flipbook__flipbook']['path'] = \Drupal::theme()->getActiveTheme()->getPath() . '/templates';
    }
Production build 0.69.0 2024