• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Template error :(

#1
<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?
 
#5
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
 

Brogan

XenForo moderator
Staff member
#8
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