AllowEmpty=true for paragraph is generated without  

Author Message

Anja Lundin

Tuesday 17 April 2007 7:20:58 am

There seem to be a bug in eZ publish 3.9.1 regarding the AllowEmpty for paragraphs in content.ini. If this parameter is set to true the XML-editor renders

<p>&nbsp;</p>

, in the file ezdhtmlxmlinput.php in the editor (OE 4.2.2) extension. So far so good.

The output of the text on the other hand is shown as only

<p></p>

without  . This results in only one break and the idea of this setting is to allow multiple empty paragraphs, isn't it?

I have noticed there is a lot of changes in the eZXHTMLXMLOutput class from 3.8.6 to 3.9.1. In example the function renderXHTMLParagraph is replaced (?) with the function renderParagraph and as far as I can see the problem is in that function somewhere.

Does anyone else have the same problem as I? Is there a bug in 3.9.1 regarding allow empty paragraphs? I haven't found any bugreports yet regarding this, should I report it?

Best regards!

/Anja Bjerleus, Novitell AB

------------------------------------
Anja Lundin
Developer, Novitell AB
Sweden

www.novitell.se

Brendan Pike

Thursday 24 May 2007 8:28:04 pm

Hi Anja, did you find any solution to this, I've run into the same problem on 3.9.0 not yet tested on 3.9.2 though.

Edit: In my opinion this is a bug, so please do report it as such. Here is a crude work around until it's fixed.

Create an override template for design/standard/templates/content/datatype/view/ezxmltags/paragraph.tpl

After

{$content}

add the following

{if $content|not}&nbsp;{/if}

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Anja Lundin

Thursday 24 May 2007 11:12:22 pm

Hi Brendan,
It's interesting to hear other people have troubles with this functionallity. For a while I was worried there was something wrong with my installations only. I will report this as a bug now.

My work around is this:


{*if there is not $content and 'AllowEmpty' for paragraph in content.ini is set to true*}
{if and($content|not,ezini('paragraph','AllowEmpty','content.ini')|eq('true'))}
<p{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>&nbsp;</p>

{*otherwise*}
{else}
<p{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content}</p>
{/if}

Best regards!

/Anja Bjerleus, Novitell AB

------------------------------------
Anja Lundin
Developer, Novitell AB
Sweden

www.novitell.se

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.