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

Permalink
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):
http://themes.momizat.com/?theme=goodnews...

siton
 
PineCreativeLabs replied on at Permalink Best Answer Reply 1 Attachment
PineCreativeLabs
I did this on my own project in the Directory for the categories.
http://www.cmsguide.info/guide/directory...

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
siton
Thanks, i will try.

Your project look great with a lot of good content - nice.
http://www.cmsguide.info/guide/directory......
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
I now have a Tutorial on this topic available! Check it out:
http://documentation.concrete5.org/tutorials/how-display-number-chi...
InSynch replied on at Permalink Reply
Instead of using this for the Auto Nav block, how would this work for the Topic List block?