Limit number of displayed categories
-
- Phoca Member
- Posts: 20
- Joined: 18 May 2011, 16:15
Limit number of displayed categories
Hi. I see there is an option to limit displayed categories with excluding IDs of categories. I'd like to limit it to display only newest 5 categories. Is there an option like this ? Thanks.
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Limit number of displayed categories
Hi, then you need to customize it in the code
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 20
- Joined: 18 May 2011, 16:15
Re: Limit number of displayed categories
Ok I managed to do this, so for those seeking for this option :
1. Edit modules/mod_phocagallery_menu/mod_phocagallery_menu.php
2. In function phocaGalleryMenuModuleMenuDown line 101 edit $query :
I wanted this module to show only 5 newest galleries, most newest on top (descending) so the SQL code would look like :
Jan, should you plan a new release of this module, consider adding couple of options like sorting categories and limiting. Thanks
1. Edit modules/mod_phocagallery_menu/mod_phocagallery_menu.php
2. In function phocaGalleryMenuModuleMenuDown line 101 edit $query :
I wanted this module to show only 5 newest galleries, most newest on top (descending) so the SQL code would look like :
Code: Select all
$query = 'SELECT cc.title AS text, cc.id AS id, cc.parent_id as parentid, cc.alias as alias, cc.access as access, cc.accessuserid as accessuserid'
. ' FROM #__phocagallery_categories AS cc'
. ' WHERE cc.published = 1'
. ' AND cc.approved = 1'
. ' AND cc.parent_id = '.$category_id
. $hideCatSql
. $hideCatAccessSql
. ' ORDER BY cc.date DESC '
. 'LIMIT 5';
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Limit number of displayed categories
Hi, thank you for the guide, added to feature request list.
Jan
Jan
If you find Phoca extensions useful, please support the project