Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87530

Setting mutliple variables and filters in operators

$
0
0

Hi all,

Playing around with the new liquid markup and loving it. Have two questions though that I couldn't find answers to in the docs.

 

1) Is it possible to set multiple variables in one line, or some better way than what I'm currently doing? At present I'm adding a new line per variable, so

{% assign var1 = 1 %}

{% assign var2 = 2 %}


Just thought there might be an easier way, like perhaps

{%

     assign var1 = 1,

     assign var2 = 2

%}


2) Is it possible to use filters in operators? If so I may be doing it wrong;

{% if numericVar1 | modulo: numericVar2 == 0 %} **do whatever **{% endif %}


I thought perhaps it might be related to the bug linked below, but I've had no issues in general using variables alone with filters, only when in operators.

Bug: Liquid math filters don't work with module data


Edited because I hit post too soon.


Viewing all articles
Browse latest Browse all 87530

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>