Skip to main content

Understanding Joomla URLs and Itemids

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

Comments

Popular posts from this blog

How to extract vtiger DB data

Here is the code sample how extract data form vtiger DB with WHERE close. Sample:1 require_once('include/DatabaseUtil.php'); global $adb; $tabid = array('9','16'); $sql = "SELECT tabid, fieldname, fieldid, fieldlabel,columnname, tablename, uitype, typeofdata, presence FROM vtiger_field WHERE tabid in (" . generateQuestionMarks($tabid) . ")"; $result = $adb->pquery($sql, array($tabid)); // get result $noofrows = $adb->num_rows($result); // get number of rows $i=0; $data=array(); while($resultrow = $adb->fetch_array($result)) { $tabid=$resultrow['tabid']; $resultrow=['fieldlabel']; $data[$i]=array($tabid, $resultrow); } Sample:2 require_once('include/DatabaseUtil.php'); global $adb; $query = 'select idlists,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid =?'; $result = $adb->pquery($query, array($focus->id)); $from_email = $adb->query_result($result,0,'from_...

Ananda

Current Software Engineer at LM Jinasena and Company (PVT) LTD Past Software Engineer at Archmage (PVT) LTD Trainee software Engineer at Respere ( Sahana Company ) Education Faculty of Information technology, University of Moratuwa ( http://www.mrt.ac.lk/ )- 2005/2006 batch Dammissara National school Naththandia (2004-Maths section) Websites My Blog Facebook Ananda’s Summary I am a graduate of Faculty of Information technology University Of Moratuwa and keen on web development field and specialized on IT management. Ananda’s Specialties: Technology: Pervasive computing, mobile backend solutions, mobile solutions, GIS, neo-geography, Location based services, Web 2.0, Social web,FOSS, Disaster Management Solutions Organizational: Strategic Planning, Project Management, Business Development, New Product strategy Ananda’s Experience Software Engineer, LM Jinasena and Company (PVT) LTD L M Jinasena and Company (PVT) LTD Aug 2010 — Present Software Engineer, Archmage (PVT) LTD Archmage (...

Terminal Hand Book (Ubuntu)

Introduction In traditional UNIX environment using CLI (Command Line Interface) is more interesting and powerful other than using GUI. Specially if some one have to work with UNIX server edition without GUI he has to face big difficulty if he is poor with CLI. With new versions of ubuntu it is providing GUI interface to replace CLI commands. Any way still there are some hidden terminal commands that forgot to GUI, so that having good knowledge of CLI is important. 1. Commands for configure softwares Description Command Install software sudo apt-get install [PackageName] Install ALL the required components using 1 single command sudo tasksel Run .sh (shell commands) files sudo sh filename.sh 2.Monitor Ubuntu software processes Description Command List all process currently running ps aux List selected packge's processes ps aux | grep [package name] many more 3.Common File Operations Description Command Rem...