Joomla 1.7 modules - What am I missing? - joomla

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 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.

Related

Joomla 3 menu modules not outputting

<jdoc:include type="module" name="topmenu" title="Top Nav" />
<jdoc:include type="module" name="mainmenu" title="Main Nav" />
I have these two modules that I included in my index.php I have positions set up in my templateDetails.xml. I have created main menu, assigned its module, and given that module the position of mainmenu. I have added menu items yet nothing is output in that position. What am I doing wrong?
I was able to get it working by changing jdoc:include type from module to modules.
I thought using module was for when you have one module that only ever lives in that position. Was I mis-using it? If so please tell me the proper way.

Can I put a Joomla extension as the only item at frontend?

What I need to do is to put a Joomla extension, JDownloads, as the only item at the frontend. I mean, no menus, no header, no footer, no other things at frontend, only JDownloads.
I'm a newbie in Joomla, so I have to ask. Is this possible, at first place? If it is, how can achieve it?
Thanks!
No need to do anything other than make a single menu item to your JDownloads component. If you don't add any modules then all that will display is the component.
You could fork one of your templates (atomic is the simplest one) eg from
/templates/atomic
to
/templates/simply
tweak a few parameters in /templates/simply/templateDetails.xml
<name>atomic</name>
and in /templates/simply/index.php replace the contents of BODY tag with:
<jdoc:include type="message" />
<jdoc:include type="component" />
Then set it as your default template or use as helper for other site

Joomla Change Modules in Sidebar on diffrent Pages

I'm using Joomla 2.5.7 and want to ask, how I can change a bunch of modules in sidebar, when I change to another Page. An example to clarify my question:
I have 3 Links at the navigation bar:
Events
Shop
Blog
and a Homepage as index.html (logical).
Now, I want display in Events the modules "Where to go" and "About Location" in the sidebar.
In Shop I want to display the modules "About Dealer", "Shipping" and "Images" in the sidebar without the modules "Where to go" and "About location".
In Blog I want to display the module "About Author" in sidebar without the modules above (Where to go, about location...).
So, I know I can do this (or similar):
<?php if ($this->countModules('sidebar-a and sidebar-b and sidebar-c')): ?>
<jdoc:include type="modules" name="sidebar-a" />
<jdoc:include type="modules" name="sidebar-b" />
<jdoc:include type="modules" name="sidebar-c" />
<?php endif; ?>
SIDEBAR-A: "Where to go" and "About Location"
SIDEBAR-B: "About Dealer", "Shipping" and "Images"
SIDEBAR-C: "About Author"
But that is not my plan!
I want just the position "sidebar-a" and that the modules getting hidden (like in countModules) if they are not for this page.
I see this method on the granty framework:
<?php /** Begin Main Body **/ ?>
<?php echo $gantry->displayMainbody
'mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
<?php /** End Main Body **/ ?>
You see just simple code, but with other variables.
So very easy in the index.html but this won't work If I do copy and paste ;)(logical)
I don't know how to do it. I do not prefer to get this framework, just for this single sidebar. But there must be a way like this granty framework, but I can't understand the code very well...I'm just an amateur on php. I guess there must be a JavaScript file, which hide and display this diffrent modules.
You can see a live demo here of the single sidebar with lots of modules, which getting hidden and displayed on each page: http://app.ohanah.com/demo-v2/rt/index.php
Have someone an idea how to run this sidebar?
Thanks for reading and helping!
In the Joomla backend, go to the Module Manager, open the module you want to change, and in the bottom left, you can assign the module to specific pages. This should be what you're looking for and it will save you having to hard code it.
You can , for better handling, use the Module Everywhere extension , look for it in JED.
It helps you a lot assigning modules not only to menulinks, but even to articles.

Where to access/alter content generated by Joomla module

I have been tasked with adding a single link to a Joomla v1.5 site. For sake of brevity I won't include the backstory. Long story short ... this Joomla site is being replaced in the near future with Drupal. For the time being I need to add some content to the Joomla version.
I have a menu that consists of a series of <li> items that are hyper links to other pages. I can view the HTML source using FireBug so I can see that the Joomla template code is generating.
The Joomla template code is ...
<jdoc:include type="modules" name="menu5" />
it creates the following HTML
<li>Link #1 Text</li>
<li>Link #2 Text</li>
<li>Link #3 Text</li>
<li>Link #4 Text</li>
I can view the module named menu5 via the Joomla interface but I cannot see any way to edit the content it generates. I can change meta data regarding the menu (Title, Position, Order, Access Level, etc ..), but nothing about changing the content the menu generates. All I want to do is to insert another link in this list. I could modify the template and hardcode it except it needs to be inserted in the middle of the list.
Any Joomla gurus out there that could tell me where to modify the content this module generates?
It sounds like it's a Joomla! Menu module (in the Module Manager you can check the type column and see if its a menu type).
If it is a menu, you will need to use the Menu menu to select the right menu and then add a menu item to it. (Sorry for all the menus, it's a self referential subject).
Typically the menu module will have the same/similar name as the Menu it displays.

Template parameter menu Joomla 2.5

I try to make a template with options available in the backend, I took the doc about options and I could see that there is a setting that lists the available menu and choose the one you wishes to appear at a specific position (off position statement via modules).
Parameter in templateDetails.xml (from the doc> http://docs.joomla.org/Menu_form_field_type):
TemplateDetails.xml
<field name="mymenu" type="menu"
default="mainmenu" label="Select a menu"
description="Select a menu" />
index.php
<?php // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$mymenu = $this->params->get("mymenu");
?>
...
<?php echo $mymenu; ?>
So I though the list of recorded menus, selecting and saving is possible, no worries on that side.
My problem is I do not understand how to display the selected menu in index.php of my template. I can retrieve the name of this menu, but how to display it?
Thanks
You need to define a module position (example: menu) in TemplateDetails.xml. In your template, place this line of code where you want it to be shown:
<jdoc:include type="modules" name="menu" />
And finally, in the backend, define main_menu in the "menu" position.

Resources