Forums / Setup & design / switches and correct use of template operators

"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".

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