Template error :(

PreFiX

Member
<xen:if is="empty({$transaction.ID})">
{$transaction.servername}
<xen:elseif is="is_numeric({$transaction.ID})">
<a href="http://anotherdomain.com/?s={$transaction.ID}">{$transaction.servername}</a>
<xen:else />
<a href="http://{$transaction.ID}">{$transaction.servername}</a>
</xen:if>

The following templates contained errors and were not saved: prefixaddon_pagrindinis_list: 1) Line 13: Template syntax error.

Line 13 is just below </xen:if> - </div>

Or it's not even possible to use php functions here?
 
You may have misunderstood - your code above doesn't have a closing / for the elseif.
So you mean something like this?

<xen:elseif is="is_numeric({$transaction.ID})" />

The following templates contained errors and were not saved: prefixaddon_pagrindinis_list: 1) prefixaddon_pagrindinis_list - Line 8: Invalid condition expression
 
These are the PHP functions you can use in conditional statements:
  • is_array
  • is_object
  • is_string
  • isset
  • empty
  • array
  • array_key_exists
  • count
  • in_array
  • array_search
  • preg_match
  • preg_match_all
  • strpos
  • stripos
  • strlen
  • trim
  • ceil
  • floor
  • round
  • max
  • min
  • mt_rand
  • rand
 
Top Bottom