1

在过去的几天里,我使用 joomla 建立了一个网站。ATM 我正在​​链接菜单、文章和模块。在模板中,内容位置使用以下标记:

<jdoc:include type="component" />

这是应该呈现文章的地方。单击菜单项类型:单篇文章时,在主站点的组件区域中没有呈现任何内容。在“组件”位置显示文章的唯一可能性是使用菜单类型:特色文章。
如何在不使用特色文章的情况下获取组件位置显示的内容?

有人知道这个问题吗?

编辑:这是 index.php 的内容:这是 index.php 的全部内容:

<!--<?php
    defined("_JEXEC") or die("Restricted Access");
    JHTML::_("behavior.framework", true);
    $app = JFactory::getApplication();
    $pathtotemplate = $this->baseurl."/templates/".$this->template;
?>-->
<!DOCTYPE html>
<html>
    <head>
        <jdoc:include type="head" />
        <meta http-equiv='content-type' content='text/html; charset=UTF-8'>
        <meta charset='utf-8'>
        <link rel="icon" href="<?php echo $pathtotemplate ?>/favicon.ico" type="image/x-icon">
        <!-- own Javascripts -->
        <script type="text/javascript" src="<?php echo $pathtotemplate ?>/js/custom.js"></script>
        <!-- Google Analytics -->
        <script type="text/javascript" src="<?php echo $pathtotemplate ?>/js/google.js"></script>
        <!-- system CSS Files -->
        <link rel='stylesheet' href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
        <link rel='stylesheet' href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
        <!-- own CSS Files -->
        <link rel='stylesheet' href="<?php echo $pathtotemplate ?>/css/template.css" type="text/css" />

        <!-- delete this file after developement -->
        <link rel='stylesheet' type='text/css' href='css/template.css' />
    </head>
    <body>
        <div id="site">
            <header>
                <div id='placeholder'>&nbsp;</div>
                <div id='logo'>
                    <a href="<?php echo $this->baseurl ?>/" accesskey="h" tabindex="1">
                        <img src="<?php echo $pathtotemplate ?>/images/logo.png" width="178" height="260" name="Logo" alt="Logo von sattler energie consulting" />
                    </a>
                </div>
                <div id='headmenu'>
                    <div id='checken'>
                        <div class="headmenu">
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_blank.png" />
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_01.png" />
                            <div><jdoc:include type="modules" name="checken" /></div>
                        </div>
                    </div>
                    <div id='optimieren'>
                        <div class="headmenu">
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_blank.png" />
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_02.png" />
                            <div><jdoc:include type="modules" name="optimieren" /></div>
                        </div>
                    </div>
                    <div id='erhalten'>
                        <div class="headmenu">
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_blank.png" />
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_03.png" />
                            <div><jdoc:include type="modules" name="erhalten" /></div>
                        </div>
                    </div>
                    <div id='leben'>
                        <div class="headmenu">
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_blank.png" />
                            <img src="<?php echo $pathtotemplate ?>/images/headmenu/rund/headmenu_rund_04.png" />
                            <div><jdoc:include type="modules" name="leben" /></div>
                        </div>
                    </div>
                </div>
                <div id='subhead' class="border-radius"><h1><jdoc:include type="modules" name="subhead" /></h1></div>
            </header>
            <div id='content'>
                <div id='leftmenu'><jdoc:include type="modules" name="leftmenu" /></div>
                <div id='main'>
                    <jdoc:include type="module" name="breadcrumbs" />
                    <jdoc:include type="message" />
                    <jdoc:include type="component" />
                </div>
            </div>
            <footer>
                <div id='inner_footer' class="border-radius"><jdoc:include type="modules" name="footer" /></div>
            </footer>
        </div>
    </body>
</html>
4

1 回答 1

0

我刚试了你提供的模板代码,解决方法很简单:

删除组件的名称。

从:

<jdoc:include type="component" name="component" />

改成:

<jdoc:include type="component" />
于 2012-08-02T11:48:25.633 回答