【问题标题】:<jdoc:include type="component" /> displaying home<jdoc:include type="component" /> 显示主页
【发布时间】:2013-09-11 19:00:52
【问题描述】:

我正在构建我的第一个 joomla 网站我被困在这里 - 当我包含在我的模板 index.php 中时。

<jdoc:include type="component" />

它在我的前端显示主页。找不到解决方案需要帮助。

【问题讨论】:

  • 这正是应该做的。
  • @user2742008 - 您确实意识到下面的答案涉及在模板中编辑核心文件,这是不推荐的。显示的很可能是文章名称。这可以在文章参数中禁用。

标签: joomla joomla2.5


【解决方案1】:

创建一个自定义 Html 模块 frontcomp 并只在主页上显示它,而不在里面写任何东西。 然后在 index.php(template) 中添加以下内容

<?php if($this->countModules('frontcomp')) : ?>
<jdoc:include type="modules" name="frontcomp" style="xhtml" />
<?php endif; ?>
<?php if(!$this->countModules('frontcomp')) : ?>
<jdoc:include type="message" />
<jdoc:include type="component" />
<?php endif; ?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 1970-01-01
    • 2016-10-18
    • 2015-12-07
    • 2018-12-21
    相关资源
    最近更新 更多