<?php
/**
* $list is a list of categories, usually in function getList() in module helper, see mod_articles_categories
*/
foreach ($list as $item) {
// get parent category id
$parent_category_id = $item->id;
// get parent category params (if you need parent category image)
$parent_category_params = json_decode($item->params);
$categories = JCategories::getInstance('Content');
// get child category ids
$child_category_id = $categories->get($parent_category_id);
// get child category object
$child_category = $child_category_id->getChildren();
/* Get a list of child categories with title and link */
?>
<ul>
<?php foreach ($child_category as $key => $value) : ?>
<li><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($value->id)); ?>"><?php echo $value->title; ?></a></li>
<?php endforeach; ?>
</ul>
<?php
}
?>