switches and correct use of template operators

Author Message

James Packham

Thursday 07 April 2005 11:29:48 am

Hi all,

I haven't used ez for a while and I'm struggling a bit with my switches. Does anyone know what I need to change to get it to recognise my template operators (is_integer and is_float)?

{section loop=$image_list}
    {switch match=true}
        {case match=is_integer($count|div(2))}
	   [code]
	{/case}
        {case match=is_float($count|div(2))}
	   [code]
	{/case}
    {/switch}
    {set count=$count|inc}
{/section}

At the moment it tells me all instances of $count / 2 are floats, even though some of them are really integers... When I use them outside of the loop I find that I have both floats and integers...

I'm running ezp 3.5.1, if that's relevant.

Ɓukasz Serwatka

Wednesday 13 April 2005 12:28:33 am

Hi James,

You can use if condition

{*
    if true display code
*}
{section show=true}
    [code]
{*
    if not true display something else
*}
{section-else}
    [code]
{/section}

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

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