Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Problem with HTML formatted output


Go to End


2 Posts   1780 Views

Avatar
ml

Community Member, 1 Post

9 May 2008 at 11:25am

Has anyone run into a problem where the output of a wysywig field displays the contents as html entities (eg. </p>) instead of printing regular html? Here's my code:

Class file:
function LeftColumn() {
$data = DataObject::get_one("ProjectsHolder");
$results = DataObject::get("Page", "FeatureInLeftColumn = 1 AND ParentID = $data->ID", "Title DESC", "", $num);
return $results;
}

Template:
<% control LeftColumn %>
$ListingImage.SetWidth(100)
<h2>$Title</h2>
$PageTeaser
<% end_control %>

It works fine except $PageTeaser (a wysiwyg field) converts the html in the field to html entities as if it were a code example. The actual data in the field is fine. Any suggestions as to what could be wrong?

Avatar
Fuzz10

Community Member, 791 Posts

9 May 2008 at 7:53pm

Have look at the data-type of your field.

It is probably a Textfield... If so , change it to an HTMLText field.