Two non-empty strings:{{ "a" and "b" }}<!-- Evaluates to true -->Empty string and non-empty string:{{ "" and "b" }}<!-- Evaluates to false -->Two non-zero numbers:{{ 1 and 2 }}<!-- Evaluates to true -->Zero and non-zero number:{{ 0 and 1 }}<!-- Evaluates to false -->Two non-empty lists:{{ [1] and [2] }}<!-- Evaluates to true -->Empty list and non-empty list:{{ [] and [2] }}<!-- Evaluates to false -->Two non-empty dicts:{{ {a: 1} and {b: 2} }}<!-- Evaluates to true -->Empty dict and non-empty dict:{{ {} and {b: 2} }}<!-- Evaluates to false -->
Two non-empty strings:{{ "a" or "b" }}<!-- Evaluates to "a" -->Empty string and non-empty string:{{ "" or "b" }}<!-- Evaluates to "b" -->Defining a fallback value:{{ some_variable or "default value" }}<!-- If some_variable is defined, print its value,otherwise print "default value" -->
{% set numbers = [1, 2, 3] %}{% if numbers is containingall [2, 3] %}Set contains 2 and 3!{% endif %}{% if numbers is containingall [2, 4] %}Set contains 2 and 4!{% endif %}
{% color "my_color" color="#930101", export_to_template_context=True %}<style>{% if widget_data.my_color.color is defined %}body{background: {{ widget_data.my_color.color }};}{% else %}body{background: #000;}{% endif %}</style>
{% for content in contents %}{% if loop.index is even %}<div class="post-item even-post">Post content</div>{% else %}<div class="post-item odd-post">Post content</div>{% endif %}{% endfor %}
{% set jobs = ["Accountant", "Developer", "Manager", "Marketing", "Support"] %}{% if jobs is iterable %}<h3>Available positions</h3><ul>{% for job in jobs %}<li>{{ job }}</li>{% endfor %}</ul>{% else %}<h3>Available position</h3><div class="single-position">{{ jobs }}</div>{% endif %}
{% module "my_text" path="@hubspot/text" label="Enter text", value="Some TEXT that should be Lowercase", export_to_template_context=True %}{% unless widget_data.my_text.value is lower %}{{ widget_data.my_text.value|lower }}{% endunless %}
{% set var_one = True %}{% set var_two = True %}{% if var_one is sameas var_two %}The variables values are the same.{% else %}The variables values are different.{% endif %}
{% if content.domain is string_containing ".es" %}Markup that will only render on content hosted on .es domains{% elif content.domain is string_containing ".jp" %}Markup that will only render on content hosted on .jp domains{% else %}Markup that will render on all other domains{% endif %}
{% if content.slug is string_startingwith "es/" %}Markup that will only render on content hosted in a /es/ subdirectory{% elif content.slug is string_startingwith "jp/" %}Markup that will only render on content hosted in a /jp/ subdirectory{% else %}Markup that will render on all subdirectories{% endif %}
{% module "my_text" path="@hubspot/text" label="Enter text", value="Some TEXT that should be Uppercase", export_to_template_context=True %}{% unless widget_data.my_text.value is upper %}{{ widget_data.my_text.value|upper }}{% endunless %}