Reading:Yootheme Zoo – Modifying the number of articles on Frontpage

Yootheme Zoo – Modifying the number of articles on Frontpage

zoo joomla moduleA quick note to let you know how I hacked Yootheme Zoo 2.3. I wanted to have a different numbers of articles on the frontpage, and in the classical category view.As I did not find an easy solution (a parameter should be added to the configuration for the front page), I decided to code it.

Here is the line you have to change on line 232 in /joomla_base_dir/components/com_zoo/controllers/default.php

[cc lang="php"]// get item pagination
$items_per_page = $params->get('config.items_per_page', 15);[/cc]

should be transformed to

[cc lang="php"]// get item pagination
$items_per_page = $category_id == 0 ? 3 : $params->get('config.items_per_page', 15)[/cc]

Advanced hack

If you want you can add a new parameter in the configuration to be able to change that number in backend. Here is the code :

In the file_ **joomla_base_dir/media/zoo/applications/blog/application.xml**_ add the following new line at **line 22** :

[cc lang="php"][/cc]

Modify on line 232 in /joomla_base_dir/components/com_zoo/controllers/default.php , it should now read :

[cc lang="php"]$items_per_page = $category_id == 0 ? $params->get('config.items_per_frontpage', 5) : $params->get('config.items_per_page', 15);[/cc]