如何在启用了显示用户文章的联系页面上显示10篇以上的文章 - Joomla

时间:2012-02-16 02:42:00

标签: php joomla

在Joomla 2.5中,可以选择在其联系页面上列出作者的文章(“显示用户文章”)。但是,我只能让它列出最近的10篇文章 - 我找不到参数中的设置来改变它,所以我想我会改变{{1}中的代码。但是我很茫然。

这是文件:

/ components / com_contact / views / contact / tmpl / default_articles.php

<?php /** * @package Joomla.Site * @subpackage com_contact * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; ?> <?php if ($this->params->get('show_articles')) : ?> <div class="contact-articles"> <ol> <?php foreach ($this->item->articles as $article) : ?> <li> <?php echo JHtml::_('link', JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug)), htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?> </li> <?php endforeach; ?> </ol> </div> <?php endif; ?> 要长得多,但如果需要,我会把它包括在内。

导致此限制将列表限制为10项的原因是什么?有没有办法对其他结果进行分页?

1 个答案:

答案 0 :(得分:1)

我没有使用过joomla,但如果你去的话,请快速浏览一下 部件\ com_contact \模型\ contact.php

找到这些行:

$db->setQuery($query, 0, 10);
$articles = $db->loadObjectList();

这是查询文章数据库的地方。

没有测试过,但应该是它。