Hello!

I'm trying to find the way to show a small text ONLY when the users is in the node full view. In other words, I'm trying to hide something from the teasers.

I have tried to write in the node.tpl.php the following

<?php if ($view_mode == 'full') : ?>
Text to hide in teaser
<?php endif; ?>

but it doesn't work, and neither does

<?php if (!$view_mode == 'full') : ?>
Text to hide in teaser
<?php endif; ?>

I have also tried some other snippets but haven't been able to achieve it. Does anybody see what am I missing?

Thanks!

Comments

peterjlord’s picture

I think this should work for you

<?php if ($teaser): ?>
  <!-- teaser template HTML here -->
<?php else: ?>
  <!-- node template HTML here -->
<?php endif; ?>
dresde’s picture

It totally rocks, thanks a lot Peter.