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

Support archive

How can I test to see if a low reorder set defined?

Gavin Lawrie 19 Jan 2017 19:24 question, complete

Simple really - I am wondering what is the most efficient way to find out if a Low Reorder set exists for a given set name.

I'm guessing that it is to test with the total entries tagj - but would value confirmation of this.

I'm imagining a test like this...

{if {exp:low_reorder:total_entries set="{segment_2}"} > "0"} ... do something ... {/if}

Replies

  1. Low 20 Jan 2017 07:53

    You might need to wrap the tag in quotes in order for that to work.

    Alternatively, you could use the Query module as a faux conditional. Something like

    {exp:query sql="SELECT set_id FROM exp_low_reorder_sets WHERE set_name = '{segment_2}' LIMIT 1"} 
    ...do something...
    {/exp:query}

    Gavin Lawrie 20 Jan 2017 10:58

    Thanks. The total_entries code seems to work OK as-is: the query idea is interesting, will give that a go as an alternative if I get the chance.