Joomla 1.7 modules - What am I missing?
I am trying to work through building a template in Joomla and seem to be missing a fundamental logic here on how modules work. I have read the wiki and several tutorials which all speak of earlier versions than 1.7 so havent helped much.
Basically I have created two menus:
"Main Menu" menu type mainmenu "Sub开发者_StackOverflow Menu" menu type submenu
When I go into Module Manager though, I see both menus as follows:
"Main Menu" type: Menu "Sub Menu" type: Menu
So in my index.php the only way I can get the menu to display is with the following:
<jdoc:include type="module" name="menu" title="Main Menu"/>
<jdoc:include type="module" name="menu" title="Sub Menu"/>
if I try setting name="mainmenu" or name="submenu" they simply dont display. This basically just shows two copies of the same menu (the one set to "home" I think).
I am missing something here and I dont know what. Isnt the title suppose to tell Joomla which to display here?
I have tried setting their positions in the module manager, then wrapping them in divs with the same id as the position, that didnt change anything either. Im lost...
Could someone please explain how I am suppose to display these menus?
Any help is greatly appreciated!
You need to use module positions.
<jdoc:include type="modules" name="mainmenu-position" />
<jdoc:include type="modules" name="submenu-position" />
or you can load both menu modules into one single position
<jdoc:include type="modules" name="menus" />
Important thing is to assing the modules to the positions they get displayed in (backend).
There is only one type of menu module in Joomla, not separate module types for mainmenu and submenu.
You mention that you have two modules of type "menu" in the Module Manager.
Open them up and take a look at the paramaters under "Basic Options". Set your Main Menu 'start level' to 1 and 'end level' to 2, and set your Submenu 'start level' to 2 and 'end level' to 'all'.
That should do the trick.
精彩评论