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.

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

Paragraph tags in TinyMCE


Go to End


2 Posts   3216 Views

Avatar
Snowlord

Community Member, 7 Posts

14 August 2010 at 5:08am

Edited: 14/08/2010 5:09am

I have a custom content field built and everything is working fine, except that the TinyMCE automatically plugs in <p> </p> before and after any copy or code I add. This is really messing up the flow of the site! I've cycled through all the other formats (address, H1, H2, etc.) and all put some sort of formatting tag in front and behind my text. If I edit the HTML and delete them, TinyMCE just plugs them back in after I save it. How can I stop TinyMCE from automatically adding these formatting tags??

Thanks!

Avatar
Devlin

Community Member, 344 Posts

14 August 2010 at 9:45pm

Edited: 14/08/2010 9:54pm

Re: content I put into TinyMCE in the CMS is automatically warpped ina <p> tag. How do I stop this?

"Any help would be great"

http://lmgtfy.com/?q=tinymce+p+tag

HTML Editor Config - Setting TinyMCE Options:
http://doc.silverstripe.org/htmleditorconfig#setting_tinymce_options_eg_valid_elements

---

Edit:
If you want just the custom content field without any p tags, you could also do:

function CustomContent() {
return str_replace( array("<p>","</p>"), array("",""), $this->CustomContent );
}