Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By GalaxyWeb on
Could anybody help me to understand why I cannot print in a node.tpl.php a safe_value.
For instance, it doesn't print anything if I add this code to a node.tpl.php :
<?php $items = field_get_items('node', $node, 'field_servings');
foreach ($items as $item) { print $item['safe_value']; } ?>
I have to remove the safe_ such as:
<?php $items = field_get_items('node', $node, 'field_servings');
foreach ($items as $item) { print $item['value']; } ?>
Any help would be appreciated.
Comments
I'd assume it's because
I'd assume it's because integers are already safe, and don't need a safe_value.
Thanks for the info Jaypan. I
Thanks for the info Jaypan. I'm learning by the drup !!