Wash of unwanted zeroes

Author Message

Olav Bringedal

Wednesday 02 February 2005 6:20:53 am

Heya

I got a class that got 20 fields of integer. In the view template I'd like every value that's not 0 to show as blank.

I tried rewriting the wash method with adding a "notzero" attribute, but that's not a slick solution at all. A good string replace method would be good in the future :)

Anyone have any ideas of how to do this without messing with the kernel?

Olav Bringedal


Senior Consultant
http://Umoe-consulting.no

Ɓukasz Serwatka

Wednesday 02 February 2005 6:36:50 am

Hi,

I didn`t test it but should work...

{*Checking if attribute is not 0*}
{section show=ne($node.object.data_map.your_attr_name.data_int, 0)}
    *blank*
{section-else}
    {attribute_view_gui attribute=$node.object.data_map.your_attr_name}
{/section}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Olav Bringedal

Thursday 03 February 2005 12:54:16 am

there you go...

my one track mind looking for solution in the wrong place. So simple, im ashamed i didnt think of that.

Thanks a lot for good and quick answer :)


Senior Consultant
http://Umoe-consulting.no

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

eZ debug

Timing: Jan 31 2025 01:28:13
Script start
Timing: Jan 31 2025 01:28:13
Module start 'layout'
Timing: Jan 31 2025 01:28:13
Module start 'content'
Timing: Jan 31 2025 01:28:13
Module end 'content'
Timing: Jan 31 2025 01:28:13
Script end

Main resources:

Total runtime0.0227 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1250151.2109
Module start 'layout' 0.00570.0031 739.3359220.6875
Module start 'content' 0.00880.0122 960.0234997.8047
Module end 'content' 0.02100.0017 1,957.828133.9922
Script end 0.0227  1,991.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002812.4304140.0002
Check MTime0.00114.9839140.0001
Mysql Total
Database connection0.00135.575710.0013
Mysqli_queries0.00209.016130.0007
Looping result0.00000.052510.0000
Template Total0.00125.510.0012
Template load0.00104.286110.0010
Template processing0.00031.143710.0003
Override
Cache load0.00073.134110.0007
General
dbfile0.00146.151780.0002
String conversion0.00000.027340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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