- Issue created by @dsivori
- Status changed to Closed: duplicate
about 1 year ago 12:46pm 15 January 2024 - 🇩🇪Germany jurgenhaas Gottmadingen
This looks like a duplicate of ✨ Set Entity View Mode Active
Hello,
i'm blocked with a simple thing : render a node with a view mode different depending on a field value
I think the problem comes from the way to render the node.
I try with the event "Prepare content entity view" and with "view Content entity".
It seems i miss something.
I have a content custom type : admission with a field : field_step which contain integer.
I want change the display (view mode) of the node depending of the value of this field.
I have also a custom display mode : Init (machine name : node.init)
If field_step.value == 0 then display node with view mode : Init
If field_step.value == 1 then display node with view mode : teaser
if field_step.value > 1 then display node with view mode : default
Impossible to find the solution and display the node with the right view mode.
To simplify the process, I have removed the condition on the field even if the condition is verified.
Your help is welcome.
Thanks
Closed: duplicate
1.1
Code
This looks like a duplicate of ✨ Set Entity View Mode Active