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

Support archive

Looping through group of variables

vlado 8 Feb 2016 18:00 question, complete

Is there a way of looping through a group of variables? I'm trying to display a group like channel entries with ability to re-order from the back-end.

Replies

  1. Low 8 Feb 2016 18:13

    Not natively. But you could use the Query module to generate a list of vars.

  2. vlado 8 Feb 2016 18:42

    Can you give any example? Or some reference?

  3. Low 8 Feb 2016 22:59

    Something like

    {exp:query sql="SELECT ee.variable_name FROM exp_global_variables AS ee, exp_low_variables low WHERE ee.variable_id = low.variable_id AND low.group_id = X ORDER BY low.variable_order ASC"} 
    {{variable_name}}
    {/exp:query}


    or

    {exp:query sql="SELECT ee.variable_name FROM exp_global_variables AS ee, exp_low_variables low WHERE ee.variable_id = low.variable_id AND low.group_id = X ORDER BY low.variable_order ASC"} 
    {exp:low_variables:parse var="{variable_name}"}
    {/exp:query}


    ...where X is the group ID (which you should be able to see in the edit group URL.

  4. vlado 9 Feb 2016 08:42

    Oh, I was apparently forgot about the jQuery module as part of EE.
    Thanks s lot for these - I'll try them.