Forums / General / How do I make Online Editor produce multiple line breaks?

How do I make Online Editor produce multiple line breaks?

Author Message

Espen R

Thursday 08 November 2007 7:12:26 am

I want to be able to use serveral line breaks in a row.

The html should be output like this:

----------
<p>
some text<br />
<br />
<br />
some more text
</p>
--------

Currently the OE strips it down to one <br />.

Please guide me in the right direction.

OE 4.2.3 - eZ 3.9.2

Mark Marsiglio

Thursday 08 November 2007 7:49:33 am

This is disabled by default because it interferes with the concept of separation of content and presentation.

You can re-enable the ability to add multiple consecutive line breaks by overriding the AllowEmpty setting in content.ini.

Put this is in the content.ini.append.php file for your user and admin siteaccesses.

[paragraph]
AllowEmpty=true

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Tony Wood

Thursday 08 November 2007 10:05:25 am

Hi Mark,

I think this rule was meant to be broken :)

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Espen R

Monday 12 November 2007 6:44:52 am

Thanks a lot Mark. I still don't think this will allow me to make several <br /> in a row. At least OE still wouldn't let me. It did however allow empty paragraphs, and if that's the only available option then I guess we'll have to live with that. :-\

Pascal France

Thursday 22 November 2007 7:42:43 pm

Hi,

I've tested the AllowEmpty=true option in content.ini.append.php (in both user and admin siteaccess) and the result is not the one we could expect:

In the preview admin interface I get this source code:

<p>Text of my paragraph</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>Pascal</p>

But in the page of the public site I get this source code:

<p>Text of my paragraph</p>
<p/>
<p/>
<p/>
<p> Pascal </p>
So there are no break line and the result is like if I hadn't turn on the AllowEmpty option.

Did I miss something else ? (I use ez 3.9.4 and OE 4.2.4)

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Espen R

Friday 23 November 2007 2:17:21 am

I guess it's correct to say that the <i>paragraphs</i> are empty. These would normally be stripped away without the AllowEmpty attribute set to true.

An empty paragraph is not the best solution in my opinion because a <br> would normally give a spacing of one line height while the paragraph would give some more, often a double line height. This results in less control for the user.

While I agree that most of the time this kind of layout manipulation should be avoided, it is sometimes a demand from the client that can't be denied them.