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.
I have a field collection called field-list
and inside that collection I have a field called field_extratext
.
So I created a tpl file field--field-extratext--field-list.tpl.php
and inside that file I have print render($content);
.
This works fine and the value gets printed, but if I change the contents of field--field-extratext--field-list.tpl.php
to
<span><?php print render($content); ?></span>
it renders nothing!
This
<?php print '<span>' .render($content). '</span>'; ?>
renders nothing.
<span>TEST</span>
renders just fine.
Comments
Comment #1
jisuo CreditAttribution: jisuo commentedAnyone else have this?
Comment #1.0
jisuo CreditAttribution: jisuo commentedadded more examples
Comment #2
jmuzz CreditAttribution: jmuzz commented$content is NULL . Try $items. It does seem strange that it would have different behavior compared to the template file not existing at all. This may be related: #1157794: Move markup to template files and improve theming in new 2.x branch
Comment #3
jmuzz CreditAttribution: jmuzz commented