DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Gallery: Display A List Of Parent Categories Only
The below displays a list of all parent categories for a certain Gallery. Be sure to change the gallery_id if yours doesn't have an id of 1.
{exp:query sql="SELECT cat_id, cat_name FROM exp_gallery_categories WHERE gallery_id='1' AND parent_id='0' ORDER BY cat_order"}
<li><a href="{path=gallery/subcat}{cat_id}">{cat_name}</a></li>
{/exp:query}





