Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 !!
<div class="row"> <span class="suffix">Count</span></div>
Can you tell me what should I do to repair this problem ?
Comments
Comment #1
apmsooner CreditAttribution: apmsooner commentedI believe you should change the display formatter for the field to unsanitized and you should get the desired output.
Comment #2
sjhuskey CreditAttribution: sjhuskey as a volunteer commentedapmsooner is correct. The unsanitized display formatter is the right choice if you need to have html tags properly rendered in your display output.