i must override a type.html.twig in my customized module.
i used hook_theme_suggestions_alter in my .theme file so as to add new strategies.
perform MY_THEME_theme_suggestions_alter(array &$strategies, array $variables){ if (isset($variables['element']) && isset($variables['element']['#type']) && $variables['element']['#type'] == 'type') { $original_theme_hook = $variables['theme_hook_original']; $strategies[] = $original_theme_hook . '__' . str_replace('-', '_', $variables['element']['#id']); } return $strategies; }
Drupal Developer debug present me this strategies
THEME HOOK: 'type' --> <!-- FILE NAME SUGGESTIONS: * form--pom-mapping-setting-form.html.twig x type.html.twig --> <!-- BEGIN OUTPUT from 'core/modules/system/templates/type.html.twig' -->
if i put form–pom-mapping-setting-form.html.twig in my_theme/templates/ folder works.
if i put form–pom-mapping-setting-form.html.twig in my_module/templates folder does not works
I do not perceive why :/
why drupal does not learn templates in module folder?
thanks