Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Variable tags are used to create new Liquid variables.
assign
Creates a new variable. Assignments can also use filters to modify the value.
Code
{% assign is_valid = true %}
{% if is_valid %}
It is valid.
{% endif %}
{% assign name = dave bowman' | upcase %}
{{ name }}
Output
It is valid.
DAVE BOWMAN
capture
Captures the content within its block and assigns it to a variable. This content can then be rendered later by using output tags.
Code
{% capture hello %}Hello, {{ user.fullname }}.{% endcapture %}
{{ hello }}
{{ hello }}
Output
Hello, DAVE BOWMAN.
Hello, DAVE BOWMAN.