[Solved] How to show the number of items in each category?

Phoca Documentation - creating documentation in Joomla! CMS
josray
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 03 Feb 2009, 18:43

[Solved] How to show the number of items in each category?

Post by josray »

Hi guys, many thanks to the Phoca Staff for the brillant work on their extensions, especially for Phoca Documentation which I find superb.

I have an issue that I'm sure could be usefoul also for other people.

When I link to a menu item the component (Phoca Documentation) it shows on the page a directory made with sections and categories. What I find limiting is that the component doesn't show immediately the number of items contained in each category. You can see that number only by entering in the category, but the user should know if an item is available in a category only by looking at the main page of the component.

Is there a way or a hack to make this possible?

Many thanks in advance.

Best regards

Jos
Last edited by josray on 06 Feb 2009, 22:46, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Req] How to show the number of items in each category?

Post by Jan »

Hi, the feature is there but not used (I will implement it as parameter value into the next version

Now you can change it in :
com_phocadocumentation/views/sections/tmpl/default.php

just uncomment the line 23

Jan
If you find Phoca extensions useful, please support the project
josray
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 03 Feb 2009, 18:43

[Solved] How to show the number of items in each category?

Post by josray »

Thank you Jan!

FYI, it doesn't work just by uncommenting the line 23, you have to join togheter line 22 and 23:

before:

Code: Select all

line 22    $catOutput 	.= '<a href="'. JRoute::_('index.php?option=com_phocadocumentation&view=category&id='.$valueCat->id.':'.$valueCat->alias.'&Itemid='. JRequest::getVar('Itemid', 1, 'get', 'int')).'">'. $valueCat->title.'</a>';

line23     echo ' <small>('.$valueCat->numdoc.')</small></p>' . "\n";
after (all on one line):

Code: Select all

$catOutput .= '<a href="'. JRoute::_('index.php?option=com_phocadocumentation&view=category&id='.$valueCat->id.':'.$valueCat->alias.'&Itemid='. JRequest::getVar('Itemid', 1, 'get', 'int')).'">'. $valueCat->title.'</a> <small>('.$valueCat->numdoc.')</small></p>' . "\n";
Jos
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Solved] How to show the number of items in each category?

Post by Jan »

Ok, yes ... thank you for this information...

Jan
If you find Phoca extensions useful, please support the project
Post Reply