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

Support archive

Low variable filter by status?

Sara Leavitt 6 Jun 2013 18:53 question, complete

Would like to use low variables with a preview template, but when we add the status parameter it breaks:

{exp:low_variables:parse var="lv_home_slides" limit="10" status='open|Preview'}

What is the correct way to filter by status?

Replies

  1. Low 6 Jun 2013 22:40

    What is the type of the lv_home_slides variable?

  2. Sara Leavitt 6 Jun 2013 23:04

    Playa (text field holding name of image file)

  3. Low 6 Jun 2013 23:29

    Might be a Playa issue, then. What happens when you use the Playa tag itself?

    {exp:playa:children var="lv_home_slides" limit="10" status="open|Preview"} 
    ...
    {/exp:playa:children}

  4. Sara Leavitt 7 Jun 2013 17:53

    We have 3 instances of "lv_home_slides" one of which is set to "Preview." When we run the "exp:playa:children" code above loops 3 times and we get 3 sets of the Playa variable which contains all the instances, including the Preview instance. If we remove "Preview" then it loops twice and we get 2 complete sets including the preview instance.

    So the loop is seeing the "Preview" status and is skipping output but on the other 2 loops it is still outputting all 3 instances. I think we need to parse the Playa variable within the loop or add an index to get only the non-Preview instances?

  5. Low 8 Jun 2013 12:05

    I'm still not quite sure what it is you're trying to accomplish from your description. Can you perhaps post some screenshots of the Low Variable settings in question, and some code you're using in your templates? You can best use pastie.org for sharing code. Thanks.

  6. Sara Leavitt 9 Jun 2013 00:09

    We did another test in a brand new template and both playa and lv work fine with the status filter, so must be something else about the template that is messing it up. Thanks for now!