Joomla 1.7 and Joomla 2.5中限制related_itmes模块返回的文章数量
Posted On 2012年3月17日
Joomla 1.7 has a nice module mod_related_items (Articles Related) that shows articles related to the current one the visitor is browsing. It has one issue though, you can’t set a limit.
So a little code hacking is in order. Open modules/mod_related_items/helper.php and go to line 94 (right after the Filter by language if) and modify $db->setQuery($query); to read:
View Code PHP
Of course you can change the limit from 10 with whatever you like. Random order is commented out because using ORDER BY RAND has performance issues. If you think you can handle it feel free to uncomment.
This hack also works for Joomla 2.5!