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

Jaypan’s picture

I'd assume it's because integers are already safe, and don't need a safe_value.

GalaxyWeb’s picture

Thanks for the info Jaypan. I'm learning by the drup !!