Forums / Setup & design / Unwanted br tags, where do they come from?

Unwanted br tags, where do they come from?

Author Message

Mark Irvine

Thursday 01 April 2004 9:23:46 am

Hi,

I've created a class with an attribute 'wanted_offered' which is a select list where user selects wanted or offered. When I try to show what was selected in a template with:

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

I get:
Wanted<br/>

My question is, where does the br tag come from? And how can I stop ezpublish from outputting this br tag?

Thanks,
Mark

Bruce Morrison

Thursday 01 April 2004 3:05:22 pm

Hi Mark

The template design/standard/templates/class/datatype/view/ezselection.tpl generates the output for the selection datatype.

You can copy this file to design/"your design"/templates/class/datatype/view/ezselection.tpl and make any adjustments to it.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Frey Staso

Monday 14 March 2005 9:27:57 am

This thread is a little old, but I figure better to bring it back than make a new thread on the same problem. I understand that I need to override this template, however I am unable to discern WHAT needs to be changed, nothing jumps out at me. Here is the override code in the default file:

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
<div class="block">
<label>{'Type'|i18n( 'design/standard/class/datatype' )}:</label>
    {section show=$class_attribute.data_int1}
        <p>{'Multiple choice'|i18n( 'design/standard/class/datatype' )}</p>
    {section-else}
        <p>{'Single choice'|i18n( 'design/standard/class/datatype' )}</p>
    {/section}
</div>

<div class="block">
<label>{'Options'|i18n( 'design/standard/class/datatype' )}:</label>
{section show=$class_attribute.content.options}
<table class="list" cellspacing="0">
{section var=Options loop=$class_attribute.content.options sequence=array( bglight, bgdark )}
<tr class="{$Options.sequence}"><td>{$Options.item.name|wash( xhtml )}</td></tr>
{/section}
</table>
{section-else}
<p>{'There are no options.'|i18n( 'design/standard/class/datatype' )}</p>
{/section}
</div>

Thanks!

Arran Price

Tuesday 15 March 2005 2:14:28 pm

Are you sure you have the right template?
Heres the code we used in our copy/override ezselection.tpl
It should only have the <br/> removal being different from the standard one.

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{* This version has <br/> tag removed - Arran Price Cerebrate Ltd 3 Feb *}
<div class="block">
 {section show=$class_attribute.data_int1}{"Multiple choice"|i18n("design/standard/class/datatype")}{section-else}{"Single choice"|i18n("design/standard/class/datatype")}{/section}
</div>

{section name=Option loop=$class_attribute.content.options}
  {$Option:item.name|wash(xhtml)}
{/section}

Frey Staso

Tuesday 15 March 2005 2:51:25 pm

I must be trying to override the complete wrong thing because no matter what I do to /class/datatype/view/ezselection.tpl in plain_user it doesn't change a thing...plus it is weird that the standard code I started with was so different from yours...

let me try a few things in this line of thought and the code you posted. Thanks a lot btw, this ezpublish thing was sort of dumped in my lap and its tricksy to say the least.

edit: ok baby steps
design/standard/templates/class/datatype/view/ezselection.tpl was the code I posted above. Putting an override on this file of the code does nothing. If I delete the code it doesn't change. This leads me to believe that I am editing the wrong file, even though I have checked the path name several times. Which file should I be overriding?

edit again: whoo! ok here was my problem, as expected I WAS overriding the wrong thing. I SHOULD have been overriding /content/datatype/view/ezselection.tpl

thanks again arran

Arran Price

Tuesday 15 March 2005 4:08:34 pm

Try putting your code (or what I posted) in
design/intranet/templates/content/datatype/view/ezselection.tpl
(replace intranet with your sitename as appropriate).
You shouldnt need an override for this.
See if that works for you. (maybe put some rubbish text in the top of the new template just so you can easily tell its working).

Let me know if that works for you.

Arran

Frey Staso

Tuesday 15 March 2005 4:32:10 pm

Works like a charm. I was trying to use the selection datatype so the user could select which picture he wanted from the drop down list and then dynamically use the selection as the file name. Obviously having <br/> in it wasn't going to go through.

Anyway just one small victory, thousands more to go ;)

eZ debug

Timing: Jan 18 2025 19:27:24
Script start
Timing: Jan 18 2025 19:27:24
Module start 'content'
Timing: Jan 18 2025 19:27:24
Module end 'content'
Timing: Jan 18 2025 19:27:24
Script end

Main resources:

Total runtime0.1747 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.9766180.8125
Module start 'content' 0.00720.0055 769.7891102.0547
Module end 'content' 0.01270.1619 871.8438530.3750
Script end 0.1746  1,402.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00382.1794200.0002
Check MTime0.00140.8170200.0001
Mysql Total
Database connection0.00090.505310.0009
Mysqli_queries0.124971.51601410.0009
Looping result0.00160.91491390.0000
Template Total0.161592.410.1615
Template load0.00110.627410.0011
Template processing0.160491.794710.1604
Override
Cache load0.00080.452810.0008
Sytem overhead
Fetch class attribute can translate value0.00090.511610.0009
XML
Image XML parsing0.00050.265710.0005
General
dbfile0.00392.2291200.0002
String conversion0.00000.004030.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs