Score:2

Views performance: Teaser vs Fields

de flag

I have to create a view on a Drupal 7 site which will have 6/8 node fields. There will be some logic for which I will have to rewrite results as well as create a views-view-field-XX.tpl.php template file.

Thus, instead of using fields, using Content > Teaser and writing/reusing the logic in the node--CONTENT-TYPE.tpl.php template file looks more tempting to me. It also seems to make my work easier.

I am worried that using Content > Teaser will impact the performance because, with fields, only the required fields will be loaded, whereas, with Content > Teaser, the complete node will be loaded.

  1. If I have set only 2-4 fields for the Teaser mode in Manage display, will the view still load the complete node?

  2. In the case the view loads the complete node, does it harm performance? Views Row Style - Fields vs. Teaser? and Fields vs. Teaser/Node view say it does impact performance, but they apply to Drupal 6.

leymannx avatar
ne flag
You can probably easily check this out yourself by having a local copy of your site, try both approaches and then check the performance tab in your browser's developer tools. I'd always go for view modes. Views fields are much harder to maintain in the long run, especially for markup changes. View modes provide more consistent UI and clearer templates.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.