简体   繁体   中英

Joomla main menu won't show up

Quite new to Joomla templating and I am stuck for a while now on including the main menu..

I read the documentation and I saw we need to use te Title tag and the module name of the menu to include this into the template. So id did.. but the menu won't show no matter what I do.

The include I do in my index.php

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

How the menu looks in the cms 在此处输入图片说明

I added also these lines which gives me content data (so the connection must be OK);

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

My tempalteDetails.xml look likes;

<?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>
<jdoc:include type="modules" name="mainmenu" title="Main Menu" />

should be

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

check in the module list to be sure which name is assigned to the menu! :)

The is nothing wrong with the code you have used to include the menu module, therefore I believe you either, haven't created the actual module for the main menu, or you haven't published it. If you haven't created it then follow these steps:

  1. Go to your Module Manager in the Joomla backend
  2. Click the "New" button and select menu as the type.
  3. In the module parameters, set the menu to be displayed as the Main Menu
  4. Assign the module the designated position set it to published
  5. Click save

Hope this helps

<jdoc:include type="modules" name="mainmenu" title="Main Menu" /> Is requesting modules assigned to the position "mainmenu" which is not listed in your XML. I suspect that you really mean to have module which requests by title.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM