Post by musicweb » Sun May 18, 2025 8:44 pm

Trying to insert a routine into my twig template but it fails.
Probably have the syntax wrong.
Here is the if, and, or line that fails:

Code: Select all

{% if timeleft > 0 and logged == true and ({{cust_chase_id}} == bt2 or {{cust_chase_id}} == mg1) %}
I think it's the way I'm using 'and' and 'or', and maybe the parentheses are wrong?

New member

Posts

Joined
Mon Aug 17, 2015 7:23 pm

Post by Johnathan » Sun May 18, 2025 10:58 pm

You don't use {{ and }} in an "if" statement, and if you're comparing for strings those should be set with apostrophes, so it should look like this:

Code: Select all

{% if timeleft > 0 and logged == true and (cust_chase_id == 'bt2' or cust_chase_id == 'mg1') %}

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by musicweb » Sun May 18, 2025 11:06 pm

Thanks Jonathan...
Your solution worked perfect!

New member

Posts

Joined
Mon Aug 17, 2015 7:23 pm
Who is online

Users browsing this forum: No registered users and 26 guests