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

jisuo’s picture

Anyone else have this?

jisuo’s picture

Issue summary: View changes

added more examples

jmuzz’s picture

Issue summary: View changes

$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

jmuzz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.