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:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

TextareaField generates <br /> tags. How to disable this behaviour?

Go to End

3 Posts   2359 Views


Community Member, 33 Posts

10 June 2009 at 12:19am


im using TextareaField for storing Adsense code. Generated code is splited into new lines. If i place this code, everything is OK, but if I reopen & republish, its lost. I think its because its replacing new lines with break tag <br />. Any idea?




Community Member, 712 Posts

10 June 2009 at 1:40pm

It's probably better to put your adsense stuff into your templates, rather than make them editable from the CMS. Still, are you sure that it is happening in the CMS? What does the template look like? Make sure you're using the raw result, and not converting to XML at some point.


Community Member, 33 Posts

10 June 2009 at 7:23pm

My customer cant edit template if something changes in the future :( He doesnt have enought skills to do it.

It doesnt make sense, that in databased CMS is problem with storing data like adsense code and suggestion is "place it in template" :( I saw this suggestion in more places in this forum...

Im not converting into XML. If i place code in backend and hit "Save and Publish" output on website is correct. Problems is here -> i reopen page in backend -> in this case is my code changed (<br /> replacing new lines) and when i hit "Save and Publish" code in frontend is broken...