EE Insider Tips
Sponsored by Mijingo's EE 2 Screencasts
ExpressionEngine mini-howtos created by the EE Insider community.
Gallery: Drop Down List of Sub Categories Only
Do you use Gallery Categories just for organisation and want a drop down navigation that contains only subcategories?
Well here you go!
<form>
<select name="URL" onChange="window.location=this.options[this.selectedIndex].value">
<option value=" ">Category Jump Navigation</option>
{exp:query sql="SELECT cat_id as category_id, cat_name AS category_name FROM exp_gallery_categories WHERE parent_id != 0"}
<option value="{p.ath="gallery/category/C{category_id/}">{category_name}</option>
{/exp:query}
</select>
</form>
(Remove the dot from path=)
Email
Print
Post to Twitter
Post to Delicious
Add Your Comment?
You must have an EE Insider account to post comments on Insider Tips. It's fast, easy and hassle-free.
Sign up now (or login).