For what it’s worth, thought I’d post this code in case it helps another newbie. I just wanted to list the child categories (ie, subcategories )of a parent category in a bulleted list. Needed it to remain dynamic since the client will be adding child categories over time. It uses the query module.
The following example will retrieve the child categories of the parent category with an id of 42. Note that the “C” in the linked URL MUST be uppercase (thanks Robin!). This example uses a template named “team” to display the category pages, and I have the my_template_group variable defined at the top of my template file like {assign_variable:my_template_group=“meetingarchive”}. Edit the URL and parent ID to suit your needs.
<ul>
{exp:query sql="SELECT cat_id as category_id, cat_name AS category_name FROM exp_categories WHERE parent_id = '42'"}
<li><a href="{path={my_template_group}/team/C{category_id}}">{category_name}</a></li>
{/exp:query}
</ul>
