How to change how eZpublish behaves with the literal tag

Author Message

Antonio Cortese

Sunday 12 September 2004 8:35:34 pm

Hello! I've just gotten around to trying the literal tags, and I have this problem. Whenever I use the literal tag, eZpublish does this in output source code:

<p>Previous content</p>
<pre>xhtml-washed content of literal tag</pre>
<p>Following content</p>

I've successfully transformed this unwanted behaviour to a pattern that matches my needs by creating an override template for the literal.tpl, from the original:

<pre>{$content|wash(xhtml)}</pre>

to this modified version:

{$content}

and now the output source code that eZpublish produces is more similar to what I want, namely:

<p>Previous content</p>
content of literal tag
<p>Following content</p>

However, I really don't want eZpublish to break my content like this! What I'd like it to do is keep the paragraphs as they are in my xml text field, namely I'd like to have:

<p>Previous content
content of literal tag
Following content</p>

How could I make eZpublish do that? Would I have to hack an eZpublish core file or it's just a simple thing I'm missing?

Or is there a third way to place html correct content in an xml text field, without using the literal tag? I started using the literal tag to insert html in an xml text field because I read this thread:
http://ez.no/community/forum/general/why_does_the_xml_text_field_vandalize_valid_html
but maybe I didn't get something.

Thanks a lot in advance!

Bård Farstad

Thursday 16 September 2004 12:56:51 am

The literal tag is defined as a block tag. I would suggest that you use a custom tag for this instead, you can make the custom tag inline and behave the way you describe here. More information:
http://www.ez.no/ez_publish/documentation/customization/components/datatypes/ezxmltext/custom_tags

If you do want to change the behaviour of the literal tag you need to change the $isBlockTag = true; to false in ezxhtmlxmloutput.php file on line 496, but I do not recommend that.

--bård

Documentation: http://ez.no/doc

Antonio Cortese

Thursday 16 September 2004 10:45:10 am

Thanks a lot, Bård! I just tried it, and it works exactly as I needed. :)

Bård Farstad

Thursday 16 September 2004 11:30:16 am

Great, glad I could help ;)

--bård

Documentation: http://ez.no/doc

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

eZ debug

Timing: Jan 19 2025 06:13:55
Script start
Timing: Jan 19 2025 06:13:55
Module start 'layout'
Timing: Jan 19 2025 06:13:55
Module start 'content'
Timing: Jan 19 2025 06:13:56
Module end 'content'
Timing: Jan 19 2025 06:13:56
Script end

Main resources:

Total runtime0.6040 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.4141152.6563
Module start 'layout' 0.00610.0040 742.070339.4922
Module start 'content' 0.01010.5924 781.5625553.5938
Module end 'content' 0.60260.0014 1,335.156312.1094
Script end 0.6040  1,347.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5617160.0002
Check MTime0.00150.2454160.0001
Mysql Total
Database connection0.00120.197310.0012
Mysqli_queries0.549590.9670600.0092
Looping result0.00050.0757580.0000
Template Total0.572594.820.2862
Template load0.00220.370320.0011
Template processing0.570294.402720.2851
Template load and register function0.00020.037710.0002
states
state_id_array0.00080.134210.0008
state_identifier_array0.00070.111020.0003
Override
Cache load0.00180.3058300.0001
Sytem overhead
Fetch class attribute can translate value0.00050.074820.0002
Fetch class attribute name0.00100.165750.0002
XML
Image XML parsing0.00070.115820.0003
class_abstraction
Instantiating content class attribute0.00000.002360.0000
General
dbfile0.00160.2680170.0001
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs