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.