Hi all,
I have a custom made list of events made with the DataObjectManager. One of the fields (Comments) is using the SimpleTinyMCEField in the CMS pop up. Everything works fine except that the HTML tags are showing in the front-end.
Here's my code.
PHP:
//db fields
static $db = array (
'Place' => 'Varchar(255)',
'Date' => 'Date',
'Time' => 'Varchar(50)',
'Comments' => 'Text',
'Postcode' => 'Varchar(50)',
);
//Fields for the DOM Popup
public function getCMSFields()
{
return new FieldSet(
new TextField('Place'),
new DatePickerField('Date','Gig Date (for example: 20/12/2010)'),
new TextField('Time', 'Time (for example: 20.30)'),
new SimpleTinyMCEField('Comments', 'Comments'),
new TextField('Postcode', 'Postcode')
);
}
Template code:
<div id="event-list">
<% control EventDetails %>
<div class="event">
<h3><a href="$Link">$Place</a></h3>
<p>$Date.Nice - $Time</p>
<p>Comments: $Comments</p>
</div>
<% end_control %>
</div>
I've tried to use Comments.XML but it didn't work, the tags still show up in the frontend.
I was wondering if there's a way to display the HTML correctly.
Thanks in advance!
EDIT
I didn't realise that I had to use
'Comments' => 'HTMLText'
as type of field!Everything sorted now!