Problems, need help? Have a tip or advice? Post it here.
16 posts Page 2 of 2
I am using 'richtext' editable region for the Footer. Some extra <P> elements are being inputted
Code: Select all
<div class="bltxt"><cms:get_custom_field 'footer' masterpage='globals.php' /></div>


outputs
Code: Select all
<div class="bltxt"><p>here is my footer</p></div>

How can i get rid of the <P> elements?
String manipulation with PHP? Or is there a way I can stop CK-Editor placing the <p>'s
Other suggestions. Is there a way to disable the auto paragraph feature?

I want to have the output without <P> elements because the paragraph places my content further down.
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
@chichi, using 'richtext' region for simple text like that used in footer is an overkill.
I suggest you please use 'text' (or maybe 'textarea' if the text could run into multiple lines).
Doing this will also save from the auto-injected <p> elements you mentioned.
The automatically added <p></p> seriously screws up my markup. I need to use this for the footer cause there ar links and my customers wants to edit tehm. FCKConfig.EnterMode = 'br' is a choice? I want no 'auto-paragraph'
looks terrible to me:
Code: Select all
<p><h1>My text</h1><br /><p>A paragraph of text</p></p>

I'll try:
Code: Select all
enterMode : CKEDITOR.ENTER_BR,
        shiftEnterMode: CKEDITOR.ENTER_P

but it prevents paragraph tags from being generated when they "should" be placed, now inserting line breaks instead.

(1) each time the "enter" key is pressed:
config.enterMode = CKEDITOR.ENTER_P; // inserts <p></p>

(2) places "div" element instead of a paragraph:
config.enterMode = CKEDITOR.ENTER_DIV; // inserts <div></div>

(3) not wrap the text in p:
config.enterMode = CKEDITOR.ENTER_BR; // inserts <br />
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
You can use CSS to get rid of margins:
Code: Select all
.bltxt p {margin:0;padding:0}

Or even make the paragraps inlined:
Code: Select all
.bltxt p {margin:0;padding:0;display:inline}

So the will now behave as regular inline <span> elements.
I also tried to remove these additional P tags in CKE, and did it in code about 6 months ago, but don't remember now.. The solution for it I found in CKE forums

UPD: if you are looking for correcting only main P tag try:
Code: Select all
.bltxt > p {margin:0;padding:0}
Thanks for posting, your css has effect of all paragraphs in this div
Code: Select all
.bltxt p {margin:0;padding:0}
Not what I was looking for.
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
Method (3) works for now, lets see if I get along with it in the future.
correcting only main P tag is a solution, too. Thanks!
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
16 posts Page 2 of 2