Tuesday 07 September 2010 6:33:08 am
I get the same result when editing content wether I use Internet Explorer (7) or Firefox (3.5). The " " doesn't come from strong.tpl but more likely from paragraph.tpl. Here is what I get in the source code of the page with debug :
<span class="comment"><!-- START: including template: extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tpl (design:content/datatype/view/ezxmltags/paragraph.tpl) --></span>
<<span class="start-tag">p</span>>
<span class="comment"><!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/strong.tpl (design:content/datatype/view/ezxmltags/strong.tpl) --></span>
<<span class="start-tag">b</span>>Puis du gras</<span class="end-tag">b</span>>
<span class="comment"><!-- STOP: including template: design/standard/templates/content/datatype/view/ezxmltags/strong.tpl (design:content/datatype/view/ezxmltags/strong.tpl) --></span>
&<span class="entity">nbsp;</span>et juste après du texte normal.</<span class="end-tag">p</span>>
<span class="comment"><!-- STOP: including template: extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tpl (design:content/datatype/view/ezxmltags/paragraph.tpl) --></span>
<span class="comment"><!-- START: including template: extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tpl (design:content/datatype/view/ezxmltags/paragraph.tpl) --></span>
<<span class="start-tag">p</span>>&<span class="entity">nbsp;</span>Et
<span class="comment"><!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/strong.tpl (design:content/datatype/view/ezxmltags/strong.tpl) --></span>
<<span class="start-tag">b</span>>alors</<span class="end-tag">b</span>> I then had a look at the template file : extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tpl :
{set $classification = cond( and(is_set( $align ), $align ), concat( $classification, ' text-', $align ), $classification )}
<p{if $classification|trim} class="{$classification|wash}"{/if}>
{if eq( $content|trim(), '' )} {else}{$content}{/if}
</p> The thing is, the $content variable is not empty as it contains some text ("et juste après du texte normal" ) , so I don't think the problem comes from this template but it is more likely "added/generated by eZpublish" at the beginning of the content when submitting changes. I noticed that sometimes you have to edit the content twice in order to get the " ". I removed the test on $content in the template, so that the code became :
{set $classification = cond( and(is_set( $align ), $align ), concat( $classification, ' text-', $align ), $classification )}
<p{if $classification|trim} class="{$classification|wash}"{/if}>
{$content}
</p> But the result is the same ... I really think this comes from the kernel and/or ezoe, but the question is where ?? I already spent hours looking in the code but could not find it. Edit : The eZ forum "literal text" generates some extra tags : span class="comment" so the source code you can see in this post is not exactly the same as the real one.
http://www.alma.fr
|