where tag <p> appeared from ?

Author Message

Leeloo Dalas

Wednesday 18 May 2005 9:27:44 am

Hello All!
I am beginner at Ez Publish. I did read a lot of documentation, but i can understand one thing :((

In admin part i did create some content objects of the standart (classic) "Article" class.

In the template i did fetch information.
BUT!

On the page (front office) every fetched content appear with tag <p>

<p>My intro, la la la</p>

In template it looks like:

{attribute_view_gui attribute=$node.object.data_map.intro}

 

It totally destroy my design ;(

I noticed that problem appears only when attribute type of the fetched item is "XML Text field" (In my case: "body" and "intro"). But i need use this type in order to use extension xmlarea than.

Why this tag appears? How can i avoid this?
PLEASE HELP ME!

Mark Marsiglio

Wednesday 18 May 2005 10:05:29 am

Turn on the template debugging feature and it will help you see what the cascade of templates that renders the page does.

The datatype view template is my guess, but the template debug will tell all. You will need to clear the cache after enabled the debug, and beware that it will make the rest of the design look pretty bad. However, this tool is invaluable for determined where things like the <p> tags come from.

Once you find the offending template, override it by creating a new template with the same name, in the same relative location, but in your design folder (not the standard or base folders). Strip out the <p> tags and see if it worked. When it does, the template debug will reference your new template location.

Add this line to your site.ini.append.php for your user siteaccess:

[TemplateSettings]
Debug=enabled

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

Leeloo Dalas

Thursday 19 May 2005 5:29:07 am

Thanks for answer!
I turn on template debug and find out that every time when i try to fetch attribute that has type "XML Text field" some others template were included (ezxmltext.tpl and paragraph.tpl from standart directory).

So, tag <p> appeared from
design/standard/templates/content/datatype/view/ezxmltags/paragraph.tpl.

I did override it (design/corporate/override/templates/paragraph.tpl), strip out tag <p>, and cleared cash.
It works!
There is no <p> tag and design is normal.

BUT! I found out another problem. There is no <p> tag AT ALL. And it is problem in large text body (For examle in article body, where some pieces of text should be separated).

How can i manage including paragraph.tpl?

 

Leeloo Dalas

Tuesday 24 May 2005 10:10:02 am

Seems like it is impossible to forbid show ezxmltext datatype NOT enclosed into <p>content</p> anyway. The content of an ezxmltext datatype is embeded into a <paragraph> by default.

It it impossible to solve it by template overrading.
And i suppose that problem solving is in kernel .

Am i right?
Please help me! I am realy STUCK!

Dmitry Lakhtyuk

Monday 06 June 2005 5:21:24 am

To use several templates to display 'paragraph' tag inside single xml-attribute you should specify 'class' for 'paragraph' tag:

<paragraph>default paragraph.tpl</paragraph>
<paragraph class='my_paragraph_style'>your_paragraph.tpl</paragraph>

In your <i>override.ini.append.php</i> you should add:

[xml_paragraph_view]
Source=content/datatype/view/ezxmltags/paragraph.tpl
MatchFile=xml/my_paragraph.tpl
Subdir=templates
Match[classification]=my_paragraph_style

Leeloo Dalas

Thursday 09 June 2005 2:00:18 am

I don't need to use several templates to display paragraph.
I just want to avoid embeding content into this tag in the beginning and in the end of content item.
Paragraph inside content item is ok!

Problem is that content of an ezxmltext datatype is embeded into a <paragraph> by default. And it happens autonomically and I can't specify 'class' then.

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