1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

<xen:options> and categories?

Discussion in 'XenForo Development Discussions' started by Liam W, Feb 26, 2014.

  1. Liam W

    Liam W Well-Known Member

    Select drop downs can have 'categories'... How would I make them in the admin side using <xen:eek:ptions>? Is it possible?

  2. Chris D

    Chris D XenForo Developer Staff Member

    You might be able to try <xen:html><optgroup>Whatever</optgroup></xen:html>

    Inside your <xen:select> tags but I have never tried this. It may not work.
  3. Liam W

    Liam W Well-Known Member

    That didn't work, however I found out what does...

    If the $options variable is the <xen:options /> source, then the format is:

    $options = array();
    $options[] = array('label' => 'Hi'); //hi is added to root option group
    $options['Cat1'] = array('label' => 'Google'); //Google is in a category called Cat1
    $options['Cat1'] = array('label' => 'Bing'); //So is Bing
    $options['Cat2'] = array('label' => 'Ask'); //Ask is in Cat2
    alexD, digitalpoint and Chris D like this.

Share This Page