How to || Add to the Topic list the "number of childs" ?

I want in the topic list to add the {number of pages with this topic}
Blog Categories:
- topic one (5) // In my site i have 5 pages with this topic
- topic two (7)
- topic three (12)

Example (scroll down a bit to "categories" section - on the right):

View Replies: View Best Answer
PineCreativeLabs replied on at Permalink Best Answer Reply 1 Attachment
I did this on my own project in the Directory for the categories.

I did this using a custom template for the Auto Nav block. I have attached the file.

Look at line 204:
$numChildren = $ni->cObj->getNumChildren();

This adds support for getting the number of child pages. Then, on line 209:
echo  '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes  .'">' . $ni->icon .' '. $ni->name . ($numChildren > 0  ? ' (' . $numChildren . ')' : '') . '</a>';

This is where the numbers are printed.

Note that this was done for 5.6. Hopefully this should work in 5.7.
siton replied on at Permalink Reply
Thanks, i will try.

Your project look great with a lot of good content - nice.
PineCreativeLabs replied on at Permalink Reply
I now have a Tutorial on this topic available! Check it out:
InSynch replied on at Permalink Reply
Instead of using this for the Auto Nav block, how would this work for the Topic List block?