繁体   English   中英

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

[英]How to display more than 10 articles on a contact page with Show User Articles enabled - Joomla

在Joomla 2.5中,可以选择在其联系页面上列出作者的文章(“显示用户文章”)。 但是,我只能让它列出最新的10篇文章-我无法在参数中找到设置来更改此设置,因此我认为我很想在/ components / com_contact / views / contact / tmpl / default_articles.php更改代码/ 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; ?>

helpers/route.php更长,但是如果需要的话,我会在这里包括它。

是什么会导致将列表限制为10个项目? 有没有办法分页附加结果?

如果您转到components \\ com_contact \\ models \\ contact.php,我还没有使用过joomla,但已经对其进行了快速浏览

找到这些行:

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

它是在数据库中查询文章的地方。

Havent对其进行了测试,但是应该是这样。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM