Home / Joomla Tips & Tricks / Understanding Joomla URLs and Itemids 
Joomla Tips & Tricks
Mar
21
2007
Understanding Joomla URLs and Itemids
Written by Steve Burge   
Avatar

One of the most? frequently asked questions on the Joomla forums is "What is the Itemid and what does it do?". Its something that frustrates even experienced developers ... witness the post called "Damn you, infernal item IDs!!!" on WhyJoomla.com.

I thought a quick tutorial would be useful and along the way we can break down other aspects of Joomla URLs.

An Example Joomla URL and Itemid

Let's use a news item called "Joomla Weekly News Magazine Issue 10" written by Brian Teeman.

If you navigate to this news item via Joomla.org, you can see this URL in the browser bar:

http://www.joomla.org/content/view/2985/33/

You see this because inside the administrator section of Joomla.org, Search Engine Friendly URLs have been turned on (Site => Global Configuration => SEO => Search Engine Friendly URLs = Yes). Its a shorter version of the real URL produced by Joomla:

http://joomla.org/index.php?option=com_content&task=view&id=2985&Itemid=33

Breaking Down those Two URLs

Default URL
Default SEF URL
Other Examples
Component Name
option=com_contentcontent option=com_wrapper produces a page using the wrapper component
This explains what the component is being asked to do.
task=viewview

task=emailform allows you to send the page via email

do_pdf creates a PDF copy of the page

Number to identify the content item
id=29852985Joomla starts at 1 and works up, so there have nearly been 3000 articles published on Joomla.org
Number to identify the menu link leading to the content item
Itemid=3333
Joomla starts at 1 and works up. "What is Joomla?" is menu link number 26. "Submit Your News" is number 75.

What's the point of the Joomla Itemid?

The Itemid is what Joomla uses to decide which modules and templates need to appear on the page:

For example, the Itemid for Brian's article is 33. What happens if we change that to 26 for example?

http://www.joomla.org/content/view/2985/26/

  • The purple "News" template changes to the red "Main" template.
  • The "News" modules disappear and the "Main" modules appear instead.

We can do the reverse and make "What is Joomla?" appear to be a news item:

http://www.joomla.org/content/view/12/33/

When you open up the Template Manager and assign templates to a particular page or open up a Module and assign it to a page, it is the Itemid that does the work.

There is a limit to how much of this messing around you can do this on Joomla.org because the site is really 6 separate sites. Each site has its own Itemid structure. We can use the same URL as above to take us to a different page on each site:

This is one reason why we recommend that people use Open SEF, Artio SEF or SEF Advance ... lots of Joomla sites have identical URLs. A quick search on Google produces 450 pages with the same URL /content/view/12/33. If you want to stand out and help Google understand the content on your page, it helps to have a Search Engine Friendly URL Component installed.

The Future of the Itemid in Joomla

The Itemid setup is undergoing a substantial revision in Joomla 1.5. You can find out more in this post by Johan Janssens, Joomla's lead developer.

 

Comments  

 
#1 Daniel Lew 2008-06-14 02:28
It was the 1st thing I looked for when installing joomla, SEO friendly URL's.

Nice bit of information, thanks
Quote
 
 
#2 Jacen 2008-08-12 12:06
All well and good, but how do I write the PHP code to access the Itemids? THAT'S what I want to know.
Quote
 
 
#3 Sana Nasir Shaikh 2008-08-27 23:33
hi,i am using joomla for long time.but now i have discover a new problem.when i was creating a site map i saw one article with two different links but with same content . for exmaple

http://news.ebrandz.com/content/view/2006/568/
http://news.ebrandz.com/content/view/2006/1/

what is the problem ? even if i change last number 1 with any number it shows the same article .in this way sitemap contains 200 extra article.which is not good according to SEO.

can anyone tell me how can i solve this problem. thanks in advance
Quote
 
 
#4 slav 2008-09-01 05:46
I have the same problem like Sana Nasir Shaikh.
Quote
 
 
#5 Steve Burge 2008-09-01 08:49
Hi Guys

The only way to solve that problem is with a plugin such as sh404SEF, Artio SEF or SEF Advance.
Quote
 
 
#6 Jeff Foster 2009-01-28 23:53
Hi Steve,

I got a hard question for you Steve:

My programmers are trying to figure out how to assign Menu Items to web pages through PHPMYADMIN in Joomla 1.5. Remember in 1.0 you could modify itemid's in PHPMYADMIN if the wrong menu or no menu was showing up.

When using sh404SEF, in 1.5 the URL does not include a item id.

How can one manually override / change the menu item in Joomla 1.5?

Jeff
Quote
 
 
#7 joe456 2009-09-11 21:18
thank you very much for sharing! I was having a problem with module, because in those link, I simply ignore the item id, so no module comes up. now i fix it:D
Quote
 
 
#8 Geoff R 2010-05-14 04:02
Thanks. Is it possible to make an item use a particular &itemid= ?

Geoff
Quote
 
 
#9 Sagar Shah 2010-08-30 23:21
Thanks Steve.
You article helped me solve the mystery of ItemID.

-Sagar
Quote
 

Add comment


Security code
Refresh