Paragraphs field view mode hooks and template not corresponding

Created on 10 March 2023, about 2 years ago
Updated 11 March 2023, about 2 years ago

Problem/Motivation

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?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇨🇭Switzerland ginovski Zurich

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

Comments & Activities

Production build 0.71.5 2024