To simplify this issue, I just have 2 hooks:
1. customtheme_preprocess_paragraph__registration_button()
2. customtheme_preprocess_paragraph__registration_button__default()
When I access a node with a registration button with a default view mode, only the first hook is called.
Also, when I access the $variables['view_mode']
in that hook, it gives the value 'default'.
Furthermore, it only takes the paragraph--registration-button.html.twig as template, but not paragraph--registration-button--default.html.twig
I am using Drupal Core 9.5.4 and Paragraphs 1.15.0. Could this be something in my setup?
default
view mode is used as placeholder value for empty, unset... It seems very weird to overwrite the default template with another default template.hook_preprocess_paragraph__BUNDLE()
, but I've never used ahook_preprocess_paragraph__VIEWMODE()