I have added CKEditor to a simply blog. But now I am getting a large space between paragraphs, looking at the code it seems to be putting a <p> and a <br /> before and a <br /> after. I am assuming one is coming from CKEditor and one is from the blog. Any ideas how I fix this??
This is what the page source looks like when CKEditor is used:
<h1 class="title">Testing the blog</h1> <a id="29"></a><p class="time">april 15, 2010 06:06pm</p> <p class="comment"><p><br />Lorem ipsum assum augue accusamus mel id, eum blandit fabellas no, vis ut facete labitur persecuti?</p><br /> <p><br /> Vis id aperiam platonem prodesset, usu cu ignota civibus. Ut eos mundi dictas scribentur, no soluta utamur temporibus pro, ut iusto veniam deleniti vix!</p></p>
As you can see it's also putting a <p class="comment"> and a <p> at the beginning of the comment and two </p> at the end.
This is what the page source looks like when CKEditor is not used:
<h1 class="title">Testing the blog without CKEditor</h1> <a id="40"></a><p class="time">april 15, 2010 06:34pm</p> <p class="comment">Lorem ipsum assum augue accusamus mel id, eum blandit fabellas no, vis ut facete labitur persecuti? <br /> Vis id aperiam platonem prodesset, usu cu ignota civibus. Ut eos mundi dictas scribentur, no soluta utamur temporibus pro, ut iusto veniam deleniti vix!</p>
Re: Large space between paragraphs
Try using a soft return (shift-return) but this does not help with pasting text at all
Re: Large space between paragraphs
You might want to use enter mode = br, but in the end the problem is that you are trying to fight against your users. If you use a div for the container, then you won't have this kind of problems.
Anyway, it's up to you: try to keep using a configuration that it's hard and gives problems, or adjust your template slightly and use a normal setup, but we can't do miracles.
Re: Large space between paragraphs
Could you explain what you mean by this? There is a div for my content is this what you mean? The blog I am using is called simple blog and has been easy to customise to suit the website I am making, it's just I thought it might look nicer for the user if I added CKEditor.
This is the code for the add to blog page as you can see the part with the editor is in a div called content:
Everything is working except for the problem I first wrote about. I have managed to get rid of the <p class="comment"> at the beginning of the comment and one of the </p> at the end. By taking them out of the index.php of the blog but the <br /> is still appearing when you press enter. I would change the code if I knew how but I don't know how to fix it? The soft return didn't make any difference anyhow.
Any help greatly appreciated.
Re: Large space between paragraphs
Sorry to say alfonsoml but I think I agree with webhigh. After doing some more searching in the forum I found quite a few other people have this problem and lots just didn't get answered. After a bit of tweaking I found a solution, not an expert so someone out there might be able to do it better. Here's what I did:
I placed this after my <textarea name="comment"></textarea> of course the 'comment' on the first line is the name of my text area.
I worked this out from a reply by bradleydixon in another post on 24 December 2009. So thanks bradleydixon. Some people were trying to put it in config.js but I couldn't get that right.
This is what it looks like now when I view the page source:
Hope this helps someone else out there with the same problem.
Re: Large space between paragraphs
Re: Large space between paragraphs
Ok, I went to my index.php and found and removed the call to n12br and then I changed my add to blog page back the way I had it.
And it has taken the <br /> out as well. So I don't need the extra bit of code. Thanks alfonsoml that's another way to fix it and it looks neater.
One more question, I would like to add my class back to my <p> but I need to do it within CKEditor instead of the blog. Can anyone tell me how to do that?
Re: Large space between paragraphs
You could set in your server code this as the initial content when you create a new page (instead of "")