I thought I was successfully themeing CCK fields, but a small problem was pointed out to me and I don't know how to solve it. I hope somebody here can help me.
Basically I created a content-field-field_my_field.tpl.php file where at some point I use:
print $item['view'];
I thought this was the correct way to print a CCK field, but instead I realized what gets printed this way is a 'safe' version of the field; indeed, doing a var_dump($item) I found out this:
array(5) {
["value"]=>
string(3171) "<p>Test.</p><p>Test.</p>"
["format"]=>
string(1) "1"
["safe"]=>
string(3164) "<p>Test.<br/>Test.</p>"
["view"]=>
string(3164) "<p>Test.<br/>Test.</p>"
["empty"]=>
bool(false)
}
Considering that <p> is an allowed tag in my input filter, I have no idea why the 'safe' value of the field strips the closing </p> tag and substitutes it with a <br/>.
Did I do anything wrong or miss a step? Is there any way to have the 'view' not strip p tags? Or, more simply, is it safe to print the 'value' of the item? It seems to me I read somewhere it wasn't and to use 'view' instead, but I need to have all my allowed tags in there.