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

<xen:options> and categories?

Liam W

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

Liam
 

Chris D

XenForo developer
Staff member
#2
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.
 

Liam W

Well-known member
#3
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.
That didn't work, however I found out what does...

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

PHP:
$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