Hi all,
I am stuck on how to include the formatting for a text field (that is excluded from display) when I print the value of that field in a customfield.
1. I have gotten the data from the field I need, and excluded it from display. I have also confirmed that the output of this field does include the HTML formatting (line/paragraph breaks) at this stage.
2. I am able to successfully get the contents of the field to display in a customfield (within a collapsible fieldset) via the code below, but any formatting from that field disappears. I have checked my Input Format settings, as well as made sure that all the views/field output stuff can contain HTML. Still no luck!
3. I think that whatever is stripping the HTML is happening with my PHP... Has anyone done this before, or can anyone offer some tips?
<?php
drupal_add_js('misc/collapse.js');
?>
<fieldset class=" collapsible collapsed">
<legend>Discussion and notes</legend>
<div class="fieldset-wrapper">
<?php print $data->node_data_field_notes_field_notes_value; ?>
</div>
</fieldset>
Thanks!
Comments
Comment #1
intyms commentedabout formatting
use check_markup() function to display your variable using Input Format filters.
example:
see filter.module from "modules/filter" directory to find more information about check_markup() function
Comment #2
intyms commentedabout collapsible fieldsets
i would suggest to use "CTOOLS collapsible fieldsets". They are easier to theme.
to do this, install CTOOLS module from here
add the following code into the header of yout views:
add this code into your php custom field:
more information about ctools collapsible fieldsets you can find in the following file:
yoursitedir/sites/all/modules/ctools/js/collapsible-div.js
Comment #3
intyms commented