1

I have several views that display data from the same content type, Customer.

I had to decide whether the view should display the teaser and format the teaser in a custom node--customer.tpl.php or to use Views ability to specify exact fields and format those. I decided to use Views to format the fields (under Format->Show->Fields) based on the preference to configure rather than code.

However, I don't want to duplicate this field formatting for each view that needs to display customers. Is there a way to reuse the field formatting configuration from one view in a another? (besides cloning the entire view) And is there a way to keep them in sync?

2

The best way to do this is by using a display mode for the content you are trying to display. The whole purpose of display modes is to provide a way to render content in a consistent way across the site.

The field format for views is meant to provide granular control over the content displayed for that specific view. The best way to clone field formatting is to just clone the whole view and modify it from there; however, the first method is definitely the right way to do this.

[Edit] You can use the Entity View Modes module to create custom displays. Once the display is created, you can manage it from the "Manage Display" tab on the content type. If you need further customization to your display, Entity View Modes allows you to provide a custom template for each view mode.

5
  • Is there an easy way to create display modes? Also, after creating how/where do you customize the display? In a node template?
    – User
    Jan 25 '17 at 19:06
  • Added more details to my answer.
    – lukedekker
    Jan 25 '17 at 19:18
  • What do you think of Entity View Mode vs Display Suite?
    – User
    Jan 25 '17 at 19:27
  • Both are great modules. Display Suite is much more powerful, and much more complex. If you don't need the additional power of DS I would use EVM.
    – lukedekker
    Jan 25 '17 at 19:29
  • 1
    Once I started using DS or EVM in views, I rarely use field output anymore.
    – mpdonadio
    Jan 26 '17 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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