Let's look at the issue of incorrect Itemid's in Mambo (and Joomla 1.0) and what to do to prevent or fix these problems. Consider the common problems Mambo users report:
Problem:
- You have a module published to the frontpage of your Mambo site and it is appearing in other content areas of your site.
- You have a content item published to the frontpage of your site and it is inheriting the Itemid of your frontpage.
Background:
Mambo uses Itemid's in all kinds of functions right throughout the code. This is an inheritance from the very early days of Mambo and because its so deeply entrenched in the code, its one we are stuck with until we do a complete rewrite (which is what we are doing with Mambo 5.0).
Mambo content follows a structure of sections -> categories -> content item. The menu within Mambo is not simply a navigational aid - it is right at the heart of the site. Unlike static HTML pages, there are no pages within Mambo. All content is stored in the database and is retrieved as needed, once an item is called from the browser. The menu is the key in determining whether content exists.
Cause of problem:
The Itemid that is returned is dependent on how you have structured your menu. Menu items have a hierarchy, or ranking of importance as follows (from highest priority to lowest):
Content
Link - Content Item
Link - Static Content
Table - Content Section
Table - Content Category
Blog - Content Section
Blog - Content Category …
Now, remember that Mambo uses a Section -> Category -> Content Item structure.
When you create a link in mainmenu, the section/category/content that you link to is assigned an Itemid. When a "page" (or content item) is called by the browser Mambo looks for the right content and it does this by checking for the existence of an Itemid and assigning one if it doesn't already exist.
Now, let's look at this a bit closer...
Say you have a section called "News" and a category within that section called "Newsflash". Then you use this content to display within the Newsflash module on your frontpage.
If the "News" section is not linked to the menu, Mambo cannot retrieve an Itemid for the content items within that section. When that happens, the system will use the default Itemid, which is the same Itemid that is used for the page the module or content item is displayed on.
So, what is the effect of this?
Because the default Itemid has been assigned to that module or content item (which is Itemid=1 for the frontpage) whenever the link to that content is clicked, Mambo will think its on the frontpage and will display all frontpage content.
In the case of our Newsflash example, this would result in the Newsflash module loading onto the same page as the content items that are linked from within the module.
Solution:
Get into the habit of creating a menu link to all Sections within your Mambo site. Go to Table - Content Section, and link every section.
If you don't want these links to show on your site, create a new menu, do the linking there, and leave the menu hidden. This can easily be achieved by assigning the menu to a module position that does not exist in your template.
If you enjoyed this post, make sure you subscribe to my RSS feed!














{ 2 comments… read them below or jump to the comment form to add your thoughts }
Hi Elpie, how are you? I created a link (Component Frontpage) but not as the homepage of my site (not the first link in the mainmenu). However, when I click on the items in that link they inherit Itemid=1. I have a different template for the homepage than the one I would like to be displayed for the items i'm referring to.
I tried creating a Table - Content Section link in another menu and publishing the menu's module to every page but in a position that doesn't exist in the template. However, it doesn't seem to fix the problem. Any ideas?
Thanks!
Elpie & Diego
I had the same problem described by Diego (the templates and item id) but after struggling for years, eventually found a solution - you can see it by clicking on my name.
What sorted it was:
I created a new menu, and then created menu items "Table - Content Category" with exactly the same name as the category, for each category in the sections that were not displaying with a proper item id and published them. I then made sure the new menu module was allocated to a hidden position (I used "user9"), and then I went to the template manager and assigned the template which is assigned to the original module that was not showing correctly to this new "hidden menu" and voila, it all works beautifully!
Hope this helps you! It all b oils down to ALSO creating the "Table - Content Category" menu items.
Cheers
Cliff
Leave a Comment