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

Getting a template error due to bad syntax

Luxus

Well-known member
#1
I have this in my template:

Code:
 <xen:if is="{$user.message_count} > 29 AND < 100">content</xen:if>
This means if a user has more than 29 posts but less than 100, then content should be shown. But if I attempt to save the template I get a template error. TMS doesn't say what error, but says the server doesn't respond, which from experience means that something isn't right with my code. I also tried this:

Code:
 <xen:if is="{$user.message_count} > 29 < 100">content</xen:if>
but this produces a parse error which messes up my template. Can anyone please show me how it's done right?
 

Luxus

Well-known member
#3
It works, thank you very much (y)

hm.. I was just thinking isn't it possible to use an array or something? Like

Code:
<xen:if is="in_array({$user.message_count}, array(30 - 99)">
 

James

Well-known member
#4
No, because in array will require you to have all possible integers from 29 to 100 for it to work.

It'd be nice if we could do: 29 < $user.message_count < 100

... But we can't :(