Extension, Plugin

Developer
Supported

In

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

You must be logged in to post.

Conditionals inside includes

Bug (Resolved)

Fabian Socarras
Fabian Socarras

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
# 1
Developer
Causing Effect - Aaron Waldon

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
# 2
Fabian Socarras

Works like a charm now, Aaron. Thanks for the quick fix!

Causing Effect - Aaron Waldon
# 3
Developer
Causing Effect - Aaron Waldon

My pleasure, Fabian. :)