Forums / Setup & design / Wash of unwanted zeroes

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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