GetSimple Support Forum

Full Version: Removing <p> Tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The editor automatically adds in <p></p> tags to the content. Is there any way to disable that?
No there is not, because there is no valid reason to disable the usage of the P-element. If you get empty P-elements it’s because you’re creating empty rows the wrong way. The only “correct” way would be to space text through CSS.

If you give an example of when you want this to be disabled someone might be able to solve it some other way.
Well I'm making a redirect template where it just pulls the URL to redirect to from the content area, where you can paste in the URL. PHP wasn't stripping the <p> tags effectively so I though it would be easier to keep the editor from automatically adding in the <P>
I’m afraid there is no smart way to do that. But you could use a regular expression to use PHP to easily get the URL from the content variable I think.
Maybe you could just use CustomFields instead of the content area, and use something like this at the top of your template.
Code:
<?php
    $tplRedirect = returnCustomField('redirect');
    if ($tplRedirect != '') { header("Location: " . $tplRedirect); }
?>
Adding <p> tag when hitting [enter] in editor window is a CKeditor's feature.
You can change [enter] behaviour to add <br /> instead of <p>.
Just add this line to ckeditor's config.js
Code:
config.enterMode = CKEDITOR.ENTER_BR;
If you want to enter a line break instead of a paragraph, just press `[shift] + [enter]` like you would in most Word Processor's.