Log in or register to post comments
Last post
rusty256's picture
Joined: 01/09/2011
Posts: 1
CKEditor - Disable the <p> & <br /> tags
Hi everyone,

I have just started working with CKEditor for a small internal database.

I have two issues:

1. When submitting a form with a CKEditor (JavaScript intergration) textarea field, HTML <p> and <br /> tags are displayed when the field data is submitted to our database. Normal Textarea fields do not do this, and are displayed "as seen". Is there any way of disabling these HTML tags?

2. This one isn't as important but I want the CKEditor to look like a regular textarea field (no toolbars are needed). Seems to be fairly difficult to me, I've looked at the CSS and it's not so simple. Any ideas?

Many thanks
Chris
codewaggle's picture
Joined: 29/06/2011
Posts: 44
Re: CKEditor - Disable the &lt;p&gt; &amp; &lt;br /&gt; tags
Hi Chris,

Item 1:
If I understand what you're saying, you mean that the <p> and <br /> tags are part of the content generated by the editor, not that you actually see <p> or <br /> displayed on the page when you view the content in the regular web page. If that's the case, take a look at this post I wrote which explains why those tags are generated and what configuration options you have:
How to configure ckeditor to not wrap content in <p> block?
http://stackoverflow.com/questions/3339710/how-to-configure-ckeditor-to-not-wrap-content-in-p-block/7266617#7266617

Item 2:
This is the Toolbar page in the Developers Guide:
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar
You can try creating your own empty toolbar and tell the editor to load that (not sure how it will look).

You could also try using the config.removePlugins option and see if you can remove the toolbar that way (I'm not sure if it's a core plugin that can't be removed):
config.removePlugins = 'toolbar';

To remove the bottom section that shows the path you would use:
config.removePlugins = 'elementspath';

So you could try both together:
config.removePlugins = 'toolbar,elementspath';

This page has "How To's":
http://docs.cksource.com/CKEditor_3.x/Howto
The "Interface" section has some guides for working with the toolbar

This page lists all of the configuration options you can work with, it shows additional configuration settings that affect the toolbar (search for "tool" on the page):
http://docs.cksource.com/ckeditor_api/s ... onfig.html

Be Well,
Joe