0

I would like all the nodes for the "Services" content type to use the "Demo" view mode.

Structure -> Content type > Services > Manage Display tab shows 3 view modes: Default, Demo, and Teaser.

Structure -> Content Type -> Services -> Manage Display -> Demo view mode: I have one field "Marketing headline" enabled.

I added a node for the Services content type. When I visit the node, I see Body and Marketing headline but I was only expecting to see the Marketing headline field value. How can I configure in a way that all the nodes of the "Services" type use the "Demo" view mode?

Here are few screenshots:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

2
  • 1
    Does this answer your question? How to change Display modes per node (view modes)?
    – cilefen
    Jun 19, 2023 at 20:53
  • I was thinking to be able to do it using the UI without programmatically. I am just not sure how to configure a content type to a particular view mode "Demo". If Drupal allows me to create a view mode, I also expected to be able to configure it via the UI.
    – GreenTree
    Jun 20, 2023 at 15:03

1 Answer 1

1

If all nodes should be displayed a certain way you should edit the Default view mode to do it.

Creating a new view mode doesn't automatically make it being used on the content type, that is why you're still seeing the Body content.

Or if you really need to use the Demo view mode you need to provide a way to display the nodes that way. That can be done with Views, but you should be mindful about what in the end ends up visible to users, because the default paths will remain and they will use the Default View mode.


Alternatively, you could use a module that creates a page for each of the view modes: View Mode Page, although that may be an overkill in your case, you probably don't want extra paths diluting your content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.