【问题标题】:How to style the output of <jdoc:include type="component" /> within templates?如何在模板中设置 <jdoc:include type="component" /> 的输出样式?
【发布时间】:2012-09-11 22:07:48
【问题描述】:

有没有办法在不修改 Joomla 核心功能的情况下在模板中设置 &lt;jdoc:include type="component" /&gt; 的输出样式?

具体来说,我想添加一个 id 为 article 的 div 以包含文章,仅此而已。现在,在我的主题中,有一个类为 item-page 的 div,其中包括文章、评分、操作甚至评论框(添加了外部插件)。

所以,我希望新模板类似于:

<div class="item-page>
    <!-- something here -->
    <div id="article">
        <!-- The article and nothing else here -->
    </div>
    <!-- comments and whatever may be here -->
</div>

【问题讨论】:

    标签: joomla joomla2.5


    【解决方案1】:

    使用布局覆盖。

    转到您要修改其布局的视图的tmpl 文件夹,然后复制到模板的html 文件夹...所以说文章: 获取/components/views/article/default.php 并将其复制到 templates/[yourtemplate]/html/com_content/article/default.php 根据需要修改文件。

    这将默认在使用该模板的所有页面上更改它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-02
      • 2013-04-27
      • 2020-07-09
      • 1970-01-01
      • 2019-09-24
      相关资源
      最近更新 更多