Published by Mijingo

tips icon image

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

User's avatar
  • Posted by Hambo
  • July 16, 2009
  • 1 person has found this tip helpful.

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=)

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).

Search EE Insider Tips
Sponsored By