html 如何在带有Liquid的if语句中使用多个参数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 如何在带有Liquid的if语句中使用多个参数相关的知识,希望对你有一定的参考价值。

{% if include.featured == true and product.featured == true %}
  {% assign test = true %}
{% endif %}

{% if include.featured == false and product.featured == false %}
  {% assign test = true %}
{% endif %}

{% if test %}
  Yepeeee!
{% endif %}

<!--
Another way you can condense this is to combine else if statements, and booleans don't necessarily need the "==" when evaluating true:
-->

{% if include.featured and product.featured %}
  {% assign test = true %}
{% elsif include.featured == false and product.featured == false %}
  {% assign test = false %}
{% endif %}

以上是关于html 如何在带有Liquid的if语句中使用多个参数的主要内容,如果未能解决你的问题,请参考以下文章