Skip to content

Instantly share code, notes, and snippets.

@GDmac
Created May 25, 2011 17:32
Show Gist options
  • Save GDmac/991435 to your computer and use it in GitHub Desktop.
Save GDmac/991435 to your computer and use it in GitHub Desktop.
Select menu with gwcode_categories
[select name="category[]" id="categories" multiple="multiple"]
{exp:gwcode_categories channel="locations_channel" style="linear"}
{if "{new_group}"=="yes"}
{if {cat_count}>1}
[/optgroup]
{/if}
[optgroup label="{cat_group_name}"]
{/if}
[option value="{cat_id}"]{cat_name}[/option]
{/exp:gwcode_categories}
[/optgroup]
[/select]
/* with end_group*/
<pre>
{exp:gwcode_categories channel="locations_channel" style="linear"}
{if "{new_group}"=="yes"}[optgroup label="{cat_group_name}"]
{/if}[option value="{cat_id}"]{cat_name}[/option]{if "{end_group}"=="yes"}
[/optgroup]{/if}
{/exp:gwcode_categories}
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment