Forums / General / How to change how eZpublish behaves with the literal tag

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