Greetings,

I want to highlight some items in a view based on a content flag. My idea is to use a custom field at the beginning of the field list to open a div and another at the end to close:

<?php if ('Y' == $data->node_data_field_att_field_att_value)
echo '<div class="attention-alert"> sample text ';
?>

what I get is

<div class="attention-alert"> sample text      </div>  

the trailing

is NOT wanted and NOT specified.

I close the div myself with another custom field at the end of the field list.

Why is the

there? More importantly, how can I get rid of it?

help!

Comments

IncrediblyKenzi’s picture

Is this in your views template? I would recommend putting it there rather than introducing a custom field, you add the conditional to the views template.

See: http://drupal.org/node/312220 for info on how.

Also, the http://drupal.org/project/flag_classes project looks like it could use some help moving along as well, but might be a starting point (release is on github).

Peter76’s picture

Make a new Input format and deselect all filters especially HTML filter.
Now in views field select that input format.