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

Support archive

Low variable and Select Categories

Samsull 11 Oct 2012 11:35 question, complete

Hi,

I have a Low Variable using Select Categories type.

It's blank on the front end - isn't it supposed to work like a Select variable type?

{exp:low_variables:options var="lv_industry_sector"}
{lv_industry_sector:data_label}
{/exp:low_variables:options}

Replies

  1. Low 11 Oct 2012 11:40

    Hi Sam,

    About the Options tag:

    This tag pair allows you to display the options for a given variable. Use this in combination with the Checkbox Group, Radio Group and Select variable types.


    So, you can't use that tag using a Select Categories var type, which returns:

    [...] either the category id of the single selected item or a list of selected category ids, separated by the chosen separator.


    To get a list of the categories you selected, you'll need to use the variable as input for a exp:channel:categories tag or a exp:query tag.

  2. Samsull 11 Oct 2012 11:47

    No problem, just curious. Using the categories tag is fine eg:

    http://d.pr/i/mvmC

    Thanks for your lightening fast response!

  3. Low 11 Oct 2012 11:49

    Cool. You could use the Show parameter to only show the categories selected in the LV.

  4. Terry Evans 19 Sep 2013 19:43

    Any idea how I can control the display order of categories listed via the exp:channel:categories tag?

  5. Low 20 Sep 2013 07:35

    Since the channel:categories tag doesn't support a fixed_order parameter, you'll have to use the Query module instead. Make sure the Separator setting for the variable is set to comma.

    {exp:query sql="SELECT cat_name, cat_url_title 
    FROM exp_categories
    WHERE cat_id IN ({my_category_var})
    ORDER BY FIELD(cat_id, {my_category_var})"
    }
    {cat_name}
    {/exp:/query}