Skip to main content

How to display a Flag in a tpl file for different View modes?

There is no field in manage display of content type to display Flag link. There is a tpl file (node--article--teaser) for teaser mode displaying bookmark

<?php if (isset($content['links']['flag'])) : ?>
    <?php echo render($content['links']['flag']);?>
  <?php endif; ?>

But for another mode this having View mode teaser_2_col and tpl file name node--teaser-2-col, $content['links'] does not have a Flag element.

neha
  • 662
  • 2
  • 10
  • 23