All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low variables & simple conditional

ejaeDesign 8 Mar 2014 16:19 problem, complete

Hi Low,

I should be able to figure this out, but it's stumping me.

I have an early-parsed LV that outputs a value based on member group. The LV itself outputs fine.

However, when I tried to do even a simple conditional it fails:

 My Plan: "{membrr_my_plan}"

Test: {if membrr_my_plan == "FRE"} YES I AM FREE! {/if}


Results simply in:
My Plan: "FRE" 
Test:

I've tried using {if "{membrr_my_plan}" == "FRE"}, {exp:low_variables:parse var="membrr_my_plan"} to no avail.

What am I missing?

Thanks!

Replies

  1. Low 8 Mar 2014 16:21

    What is the type and content of that variable?

  2. ejaeDesign 8 Mar 2014 16:25

    Hi Low,

    It's textarea and here's the content:

    {if logged_in}{exp:membrr:subscribed plan="1"}ALL{/exp:membrr:subscribed}{exp:membrr:subscribed plan="4"}FRE{/exp:membrr:subscribed}{exp:membrr:subscribed plan="5"}BSC{/exp:membrr:subscribed}{exp:membrr:subscribed plan="6"}CRT{/exp:membrr:subscribed}{exp:membrr:subscribed plan="7"}IND{/exp:membrr:subscribed}{exp:membrr:subscribed plan="8"}BNF{/exp:membrr:subscribed}{if:else}FRE{/if}

    If I'm logged in as admin, it outputs "ALL" minus quotes. If not logged in, it should output "FRE" minus quotes.

    ejaeDesign 8 Mar 2014 16:26

    Edit: I'm assuming the output would be a simple string value

  3. Low 8 Mar 2014 16:32

    I'm assuming the output would be a simple string value


    That's a false assumption.

    Early parsed variables are equal to Snippets. They are put inside the template early on in the parse order. The vars and tags inside the value will then be parsed by the template parser itself.

    You might want to look at creating a custom plugin to directly output the value you need.

  4. ejaeDesign 8 Mar 2014 16:45

    Ah - I see. Makes sense. Thanks for the quick response!