Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

variable assign in if statement #10

Closed
neilhuyton opened this issue Jul 29, 2012 · 0 comments
Closed

variable assign in if statement #10

neilhuyton opened this issue Jul 29, 2012 · 0 comments

Comments

@neilhuyton
Copy link

If a variable is assigned within an if statement, the value of that assign is not kept outside of that block.

{% assign test1 = 'maybe' %}

{% if test1 == 'maybe' %}
{% assign test1 = 'yes' %}
{% endif %}

{{ test1 }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants