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

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

Author Message

Barney Gumble

Tuesday 27 January 2004 2:34:06 pm

In 3.3.2 I noticed that my xml text fields were being enclosed with <P> tags which would make my desired layout impossible, so under advice from another forum post I edited

design\standard\templates\content\datatype\view\ezxmltags\paragraph.tpl

and removed the <P></P> tags from around the content. However my line breaks in the xml text fields were then ignored, and new lines and paragraphs impossible.

All I want is to be able to display xml text fields without a gap above and below.

Any help will be greatly appreciated as always!

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!

eZ debug

Timing: Jan 18 2025 15:59:33
Script start
Timing: Jan 18 2025 15:59:33
Module start 'content'
Timing: Jan 18 2025 15:59:34
Module end 'content'
Timing: Jan 18 2025 15:59:34
Script end

Main resources:

Total runtime1.0619 sec
Peak memory usage4,096.0000 KB
Database Queries206

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.1563180.8359
Module start 'content' 0.00500.9541 769.9922577.0703
Module end 'content' 0.95900.1028 1,347.0625337.0859
Script end 1.0618  1,684.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3461210.0002
Check MTime0.00140.1341210.0001
Mysql Total
Database connection0.00060.054510.0006
Mysqli_queries0.996093.78912060.0048
Looping result0.00160.15112040.0000
Template Total1.033097.320.5165
Template load0.00220.211520.0011
Template processing1.030897.068720.5154
Template load and register function0.00010.008310.0001
states
state_id_array0.00160.150810.0016
state_identifier_array0.00140.127820.0007
Override
Cache load0.00190.1769300.0001
Sytem overhead
Fetch class attribute can translate value0.00150.137730.0005
Fetch class attribute name0.00120.112980.0001
XML
Image XML parsing0.00090.081930.0003
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.00470.4458270.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs