自定义Joomla模块带有作者和标签的最新文章

时间:2018-09-05 07:29:43

标签: php joomla

我正在尝试覆盖Joomla!默认的最新文章模块,显示带有以下内容的文章:

  • 作者姓名
  • 作者图片
  • 文章发表日期
  • 作者姓名链接到与作者相关联的“联系人”页面
  • 文章的标签

这是我目前在覆盖模板中的default.php文件中所做的事情:

<div class="blog-item-info-hp">
    <div class="blog-item-author-main-hp">
        <div class="blog-item-title-date-hp">
            <?php echo JHtml::_('date', $item->publish_up, JText::_('d M Y')); ?>
         </div>
        <div class="blog-item-author-hp">
            <div class="blog-author-name-hp"><a href="need PHP here to link author to the joomla contact page associated to the author"><?php echo $item->author; ?></a></div>
            <div class="blog-author-image-hp"><a href="need PHP here to link author to the joomla contact page associated to the author"><img src="need PHP here to author's image" alt="need PHP here: image name" /></a></div>
        </div>
    </div>
    <div class="blog-item-text-hp">
        <div class="blog-item-title-text-hp"><a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></div>
        <div class="blog-item-title-subtext-hp">need PHP here to show article category</div>
        <div class="blog-item-title-moreinfo-hp">need PHP here for first 140 characters of the article</div>
    </div>
    <div class="blog-item-tags-hp">
        <div class="blog-orange-tag-hp"><a href="need PHP here to tag's link">need PHP here for tag's name</a></div>
        <div class="blog-orange-tag-hp blog-purple-tag-hp"><a href="need PHP here to tag's link">need PHP here for tag's name</a></div>
    </div>
</div>

我已经在代码的每个部分中写了我需要的PHP代码。我希望有人能帮助我!

谢谢。

0 个答案:

没有答案