I want to add wrapper element to CCK computed field in a content type.

I could calculate the value of field but when I use HTML tags in Display Code section the result is not rendered properly.

for example I use this code in Display Code.

$display_output =  '<div class="row">' . $entity_field_item['value'] . ' <span class="suffix">Count</span></div>';

But the result is not corrected HTML . it seems it is encoded !!

&lt;div class=&quot;row&quot;&gt; &lt;span class=&quot;suffix&quot;&gt;Count&lt;/span&gt;&lt;/div&gt;

Can you tell me what should I do to repair this problem ?

Comments

apmsooner’s picture

I believe you should change the display formatter for the field to unsanitized and you should get the desired output.

sjhuskey’s picture

apmsooner is correct. The unsanitized display formatter is the right choice if you need to have html tags properly rendered in your display output.