How to use the "or" expression in the plugin template  

This sub-forum is for discussing and reporting bugs on any content that is not available by default in Panotour, so this concerns custom HTML templates, extra plugins (both Kolor-provided and third-party), etc...

Ce sous-forum a été créé pour discuter et/ou rapporter des bugs sur tout contenu qui n'est pas disponible par défaut dans Panotour, donc cela concerne les templates HTML customisés, plugins supplémentaires, etc...
User avatar
DaShan
Member
 
Topic author
Posts: 72
Likes: 12 posts
Liked in: 6 posts
Joined: Tue May 08, 2012 6:49 am
Location: China
Info

How to use the "or" expression in the plugin template

by DaShan » Sun Jan 10, 2016 6:51 am

Hello everyone!

I only know that "or" Code written a Boolean value.
Code: Select all
{% if p.rescale.value or p.realpha.value %}


For the following form, how to write code?
Code: Select all
If A < 0 or B ≠"null"


Thanks for any form of help!

User avatar
bdd
Kolor Team
 
Posts: 2802
Likes: 14 posts
Liked in: 130 posts
Joined: Tue Jan 18, 2011 4:05 pm
Info

Re: How to use the "or" expression in the plugin template

by bdd » Tue Jan 12, 2016 4:35 pm

With our template syntax it is not as easy as in any other language .

Here is how to do it :

Code: Select all
{% set 0 as do_it %}
{% iflower A 0 %}
  {% set do_it|add:1 as do_it  %}
{% endiflower %}
{% if B %}
  {% set do_it|add:1 as do_it  %}
{% endif %}
{% ifnotequal do_it 0 %}

---

{%endifnotequal%}

DaShan likes this post.

User avatar
DaShan
Member
 
Topic author
Posts: 72
Likes: 12 posts
Liked in: 6 posts
Joined: Tue May 08, 2012 6:49 am
Location: China
Info

Re: How to use the "or" expression in the plugin template

by DaShan » Sun Aug 21, 2016 5:48 am

Thanks a lot!

It is at least part of the problem was resolved.
Dashan
---------------------------------------------------------------
eMail: 446426990@qq.com dspano@live.cn


Who is online

Users browsing this forum: No registered users and 1 guest

cron