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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

Special html characters being re-encoded in html! £ being changed to £


Go to End


2 Posts   1994 Views

Avatar
Hammy

Community Member, 49 Posts

22 November 2008 at 11:51pm

Edited: 22/11/2008 11:52pm

I have a list of currency symbols listed in my database that are entered into a text field.

For the Pound Symbol £ - I am entering £, however when I then try and use this in a template, the ampersand - &, is being encoded again as &. So this displays the symbol incorrectly as &pound on the page (or £ in the html source code) rather than £.

Is there a way to stop this from re-encoding in the template?

Avatar
Hammy

Community Member, 49 Posts

23 November 2008 at 9:21am

Found the solution on the following page:
http://api.silverstripe.com/sapphire/model/Text.html

When inserting content into a template and to avoid special characters from being re encoded - use .NoHTML

Ie $ContentType.NoHTML - simple :)