This is a quick workaround if you want to add some content to your Node template (node.tpl.php
) that you only want to display on a particular View Mode (such as Teaser or Full View).
It is in fact a simple .php conditional. Let’s say you want content to appear only in the Teaser view mode:
if ($view_mode == 'teaser') {
// content you want to display
}
For the Full View mode, you just replace teaser
with full
.
Hope this helps.

Daniel Sipos
CEO @ Web Omelette
Danny founded WEBOMELETTE in 2012 as a passion project, mostly writing about Drupal problems he faced day to day, as well as about new technologies and things that he thought other developers would find useful. Now he now manages a team of developers and designers, delivering quality products that make businesses successful.
Add new comment