【问题标题】:Joomla main menu won't show upJoomla 主菜单不会显示
【发布时间】:2014-05-04 21:25:55
【问题描述】:

对 Joomla 模板还很陌生,我现在在包含主菜单方面被困了一段时间......

我阅读了文档,发现我们需要使用标题标签和菜单的模块名称来将其包含到模板中。所以 id 做了.. 但无论我做什么菜单都不会显示。

我在 index.php 中的包含

<jdoc:include type="modules" name="mainmenu" title="Main Menu" />

菜单在 cms 中的外观

我还添加了这些行,它们为我提供了内容数据(因此连接必须正常);

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

我的 tempalteDetails.xml 看起来像;

<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="template">
        .......
        <files>
                <filename>index.php</filename>
                <filename>templateDetails.xml</filename>
                <folder>images</folder>
                <folder>css</folder>
        </files>
        <positions>
                <position>breadcrumb</position>
                <position>left</position>
                <position>right</position>
                <position>top</position>
                <position>user1</position>
                <position>user2</position>
                <position>user3</position>
                <position>user4</position>
                <position>footer</position>
        </positions>
</extension>

【问题讨论】:

    标签: php templates joomla menu


    【解决方案1】:
    <jdoc:include type="modules" name="mainmenu" title="Main Menu" />
    

    应该是

    <jdoc:include type="module" name="menu" title="Main Menu" />
    

    检查模块列表以确保为菜单分配了哪个名称! :)

    【讨论】:

      【解决方案2】:

      你用来包含菜单模块的代码没有错,因此我相信你要么没有为主菜单创建实际的模块,要么你没有发布它。如果您还没有创建它,请按照以下步骤操作:

      1. 转到 Joomla 后端中的模块管理器
      2. 点击“新建”按钮并选择menu作为类型。
      3. 在模块参数中,设置菜单显示为主菜单
      4. 为模块分配指定位置,将其设置为已发布
      5. 点击保存

      希望对你有帮助

      【讨论】:

      • 菜单似乎已经在列表中。当我使用 Joomla 的默认模板时,会呈现菜单。
      【解决方案3】:

      &lt;jdoc:include type="modules" name="mainmenu" title="Main Menu" /&gt; 正在请求分配给 XML 中未列出的位置“mainmenu”的模块。我怀疑你的意思是让module 按标题请求。

      【讨论】:

      • 我也试过模块(不带 s),但没有成功。我在xml中添加了mainmenu位置..也没有成功。
      • 模块没有标题选项。这可能是问题所在。
      猜你喜欢
      • 1970-01-01
      • 2018-04-11
      • 1970-01-01
      • 1970-01-01
      • 2018-07-29
      • 1970-01-01
      • 2012-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多