Share » Forums » Setup & design » <P> tags, <BR>s and XML text fields

<P> tags, <BR>s and XML text fields

<P> tags, <BR>s and XML text fields

Tuesday 27 January 2004 2:34:06 pm - 6 replies

Modified on Tuesday 27 January 2004 3:00:35 pm by Barney Gumble

Author Message

Alex Jones

Tuesday 27 January 2004 2:56:32 pm

What effect are you trying to achieve? You mention that you do not want the text wrapped in paragraph tags, does that mean you just want line break tags inserted?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Barney Gumble

Tuesday 27 January 2004 2:59:53 pm

Alex, all I want is to be able to display xml text fields without a gap above and below due to the embedded <P>. If I leave paragraph.tpl untouched, then my new paragraphs are fine, but the gap above and below the whole field comes back.

Alex Jones

Tuesday 27 January 2004 3:12:37 pm

Ahhh. Perhaps you could get around the issue with CSS, thus ensuring that your markup remains valid? Is the XMLTextfield within a container element? If not, could it be? If you were to wrap a div around that XML Text Field in your template and set the top and bottom margins to negative values like -0.6em you would be able to reduce or eliminate the gap you are speaking of.

Example:

<div style="margin: -0.6em 0;">{your ez code}</div>

Of course the style elements could be moved to a separate style sheet, but it get's the idea across.

Would that work?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Barney Gumble

Tuesday 27 January 2004 3:44:39 pm

Spot on, Alex. I turns out that the <P> is only critical in a small number of templates, so I've placed the field in a container as you suggested i.e. <DIV STYLE="margin: -1.7em 0 -1.7em 0;">. This starts the paragraph one line above it normally would have, and stops the gap at the end. Nice one thanks!

Alex Jones

Wednesday 28 January 2004 6:43:34 am

Happy to help! The flexibility and control provided by CSS is a wonderful thing.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Barney Gumble

Friday 30 January 2004 8:32:38 am

For anyone interested I eventually found another solution. I found that when xml textfields were placed in their own table cell, then the margins above and below did not occur. Sounds so simple really!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu