In
ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Causing Effect
Conditionals inside includes
Bug (Resolved)
Fabian Socarras
|
Posted: 19 June 2014 11:45 PM |
|
|
|
Hi,
I’m trying to use an include template as an embed (which is working), and I’m passing an embed variable to the included template. The variable is passing in, but if I test it using a conditional, it always renders as false. Here’s an example of what I’m doing:
<div class="form-group terms-services"> {exp:in:clude:partials/_terms lang="en"} </div>
<!-- Included Template --> {if embed:lang == "en"} True {if:else} False {/if}
Are conditionials suppose to work for included templates?
Thanks,
Fabian
|
|
|
Causing Effect - Aaron Waldon
|
Posted: 21 June 2014 02:48 AM |
# 1
|
|
Developer
|
Hi Fabian!
Good call. I think this would have still worked:
<!—Included Template—>
{if "{embed:lang}" == "en"} True {if:else} False {/if}
But it is better for it to work both ways. I just uploaded In version 1.2, which should resolve the issue. Please let me know if that resolves the issue for you. :)
|
|
|
Fabian Socarras
|
Posted: 27 June 2014 05:57 PM |
# 2
|
|
|
Works like a charm now, Aaron. Thanks for the quick fix!
|
|
|
Causing Effect - Aaron Waldon
|
Posted: 28 June 2014 12:33 AM |
# 3
|
|
Developer
|
My pleasure, Fabian. :)
|
|
|