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.

Archive /

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

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

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


Reply


2 Posts   1612 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 :)