In an upstream template, I do this code :
{embed="templatecategory/template" varA="{var1}" varB="{var2}"}
These variables are populated by a custom addon.
And in the next template:
{embed:varA}<br>
{if varA == 3}
its 3!
{if:else}
its not 3!
{/if}
The output is:
3
its not 3!
so the embedded variable works! its there!
I'm assuming that the conditional is being run before the variable resolves(parsing order issue). So, I've tried to use stash in the upstream template to no avail.
{exp:stash:set}
{stash:StashVar}{var1}{/stash:StashVar}
{/exp:stash:set}
And the downstream template is
<script> console.log("StashVar = {StashVar}")</script>
{stash:embed:StashVar}
<br>
{if StashVar == 3}
its 3!
{if:else}
its not 3!
{/if}
and again the output is
3
its not 3!
Note the console log I put in to see what is happening. If I run that command in the upstream template it correctly outputs
StashVar = 3
but downstream is
StashVar = {StashVar}
What's the easiest way to get those variables to the downstream template for use in conditionals?