|
Search:     Advanced search
Browse by category:
Glossary

Incorrect Itemid's

Add comment
Votes: 0
Comments: 0
Posted: 22 Mar, 2008
by: Pope L.
Updated: 02 Aug, 2008
by: Pope L.
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 by not publishing it.
Others in this Category
document How secure is Mambo?
document Blocking direct access to scripts in your wrapper
document How to install templates on your Mambo site
document How to move your Mambo site
document How to change the template name
document Troubleshooting the WYSIWYG editor
document Lost your admin password?
document Database function failed with error 1054
document Popups not working?
document CAPTCHA not working
document Working with META tags
document Blank or 'White' Pages
document How to turn off MySQL Strict Mode
document FAQ: "This Category is currently empty"
document How to find your version of PHP & other useful information
document What to do when you get a site is temporarily unavailable error
document session save path issues
document Changing/Creating your own favicon
document FAQ: Checked In/ Checked Out
document How to use Mambo Modules
document How to determine Absolute Path

RSS