Following this answer, I'm trying to override core/themes/seven/templates/node-add-list.html.twig
using hook_theme_suggestions_HOOK.
So, I added the following function in modules/custom/domain_filter/domain_filter.module
function domain_filter_theme_suggestions_node_add_list(array $variables) {
$suggestions = [];
$suggestions[] = 'node_add_list__' . 'custom';
return $suggestions;
}
I created the custom twig file in my module: modules/custom/domain_filter/templates/node-add-list--custom.html.twig
The suggestion appear well in theme debug but it's not applied (the x
is in front of node-add-list.html.twig
):
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'node_add_list' -->
<!-- FILE NAME SUGGESTIONS:
* node-add-list--custom.html.twig
x node-add-list.html.twig
-->
How to apply node-add-list--custom.html.twig
?