Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All in the title : How to programmatically embed video from tpl files ?
thank you for this GREAT module.
Cheers,
jramby.
Comments
Comment #1
jeffglenn CreditAttribution: jeffglenn commentedI see it's a little late in the reply but I thought I might anyway.
It depends on what .tpl you are wanting to print in. Printing an embedded video in the page.tpl has given me problems in the past but I found this solution that has worked great for me (not sure if it's the best way to do it):
<?php print render(field_view_field('node', $node, 'field_NAME')); ?>
Printing in a node.tpl should be much easier:
<?php print render($content['field_NAME']); ?>
Hope this helps!
Comment #2
plopescMarking as fixed
Comment #4
maxplus CreditAttribution: maxplus commentedThanks,
This worked for me to: