SlideShare a Scribd company logo
Joomla! Routing
Explained
Anatomy of a non-sef URL
index.php?option=com_content&view=category&layout=blog&id=8&Itemid=103
Itemid is king !
- Notice how you write Itemid (Capital I)
- It’s the id (primary key) of the menu created
- Modules are assigned to a menu, will show up when a link having the
respective Itemid shows up
- This means if you change the Itemid for any other link, a different set of
modules will load. This is not desirable
- If you leave out the Itemid, only modules set to show on ‘All’ pages will show
SEF URLs Explained
/index.php?option=com_content&view=category&layout=blog&id=8&Itemid=103
Changes to /news
Also,
/index.php?option=com_content&view=category&layout=blog&id=9&Itemid=104
Changes to /news/sports
SEF URLs Explained
/index.php?option=com_content&view=article&id=7&Itemid=103
Changes to /news/7-new-article-2
/index.php?option=com_content&view=article&id=10&Itemid=104
Changes to /news/sports/10-sports-article
Building a Route
- Use JRoute::_() to build a route. Pass a URL with an Itemid
- Itemid creates the first section of the SEF URL
- If the query params do not match menu entry query params
- The first URL section is created from the menu Itemid. Say /news/sports
- The querystring is passed to extension’s router to build the next part of the route, so it adds /10-
sports-article
- This is the right way to build SEF URLs
Building a Route - without Itemid
- For URLs without an Itemid, or an invalid Itemid eg:
index.php?option=com_content&view=article&id=7
- JRoute makes this /component/com_content/article/?id=7
- This is the wrong way to build SEF URLs
Itemid guessing
- Since JRoute::_() needs an Itemid
- Write a wrapper function, say JTRoute::_() that accepts a part of the URL and
guesses the Itemid
- Use this function everywhere to produce consistent URLs
Thanks !
Ashwin Date | techjoomla.com | @coolbung

More Related Content

Similar to Joomla! Itemid amd routing explained

Template Overrides
Template  OverridesTemplate  Overrides
Template Overrides
ViryaTechnologies
 
Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend Framework
Jamie Hurst
 
Websphere Commerce SEO
Websphere Commerce SEOWebsphere Commerce SEO
Websphere Commerce SEO
Shinu Suresh
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
Nile Flores
 
Drupal 8 for site builders
Drupal 8 for site buildersDrupal 8 for site builders
Drupal 8 for site builders
Kim Pepper
 
css
csscss
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation
Arumugam P
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
Mage Guru
 
7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!
Bartłomiej Krztuk
 
IBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 CustomizationIBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 Customization
rledwich
 
How Joomla! builds a webpage (annotated)
How Joomla! builds a webpage (annotated)How Joomla! builds a webpage (annotated)
How Joomla! builds a webpage (annotated)
Randy Carey
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentation
Alice Pang
 
10 ways to bind multiple models on a view in mvc code project
10 ways to bind multiple models on a view in mvc   code project10 ways to bind multiple models on a view in mvc   code project
10 ways to bind multiple models on a view in mvc code project
Akshat Kumar
 
Wordpress SEO Featuring Dave Jesch
Wordpress SEO Featuring Dave JeschWordpress SEO Featuring Dave Jesch
Wordpress SEO Featuring Dave Jesch
Wiideman Consulting Group
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NET
Mike Melusky
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
AndiNurkholis1
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The Mvc
Amit Kumar Singh
 
Tes automation for CMS Backed applications - Channel-4 Case Study
Tes automation for CMS Backed applications - Channel-4 Case StudyTes automation for CMS Backed applications - Channel-4 Case Study
Tes automation for CMS Backed applications - Channel-4 Case Study
Anand Ramdeo
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
jagriti srivastava
 

Similar to Joomla! Itemid amd routing explained (20)

Template Overrides
Template  OverridesTemplate  Overrides
Template Overrides
 
Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend Framework
 
Websphere Commerce SEO
Websphere Commerce SEOWebsphere Commerce SEO
Websphere Commerce SEO
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Drupal 8 for site builders
Drupal 8 for site buildersDrupal 8 for site builders
Drupal 8 for site builders
 
css
csscss
css
 
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!
 
IBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 CustomizationIBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 Customization
 
How Joomla! builds a webpage (annotated)
How Joomla! builds a webpage (annotated)How Joomla! builds a webpage (annotated)
How Joomla! builds a webpage (annotated)
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentation
 
10 ways to bind multiple models on a view in mvc code project
10 ways to bind multiple models on a view in mvc   code project10 ways to bind multiple models on a view in mvc   code project
10 ways to bind multiple models on a view in mvc code project
 
Wordpress SEO Featuring Dave Jesch
Wordpress SEO Featuring Dave JeschWordpress SEO Featuring Dave Jesch
Wordpress SEO Featuring Dave Jesch
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NET
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The Mvc
 
Tes automation for CMS Backed applications - Channel-4 Case Study
Tes automation for CMS Backed applications - Channel-4 Case StudyTes automation for CMS Backed applications - Channel-4 Case Study
Tes automation for CMS Backed applications - Channel-4 Case Study
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
 

More from Ashwin Date

Building modern frontends for joomla
Building modern frontends for joomlaBuilding modern frontends for joomla
Building modern frontends for joomla
Ashwin Date
 
King of Fruits - Theme based Gamification
King of Fruits - Theme based GamificationKing of Fruits - Theme based Gamification
King of Fruits - Theme based Gamification
Ashwin Date
 
Angular frontends with joomla backend
Angular frontends with joomla backendAngular frontends with joomla backend
Angular frontends with joomla backend
Ashwin Date
 
Revolutionizing kids education using joomla
Revolutionizing kids education using joomlaRevolutionizing kids education using joomla
Revolutionizing kids education using joomla
Ashwin Date
 
Git basics
Git basicsGit basics
Git basics
Ashwin Date
 
Caching and Performance Improvememts in Joomla
Caching and Performance Improvememts in JoomlaCaching and Performance Improvememts in Joomla
Caching and Performance Improvememts in Joomla
Ashwin Date
 
Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014
Ashwin Date
 
10 things you are doing wrong in Joomla
10 things you are doing wrong in Joomla10 things you are doing wrong in Joomla
10 things you are doing wrong in Joomla
Ashwin Date
 
How Joomla powers one of the biggest grain warehouses in India
How Joomla powers one of the biggest grain warehouses in IndiaHow Joomla powers one of the biggest grain warehouses in India
How Joomla powers one of the biggest grain warehouses in India
Ashwin Date
 
Deploying Joomla sites with GIT
Deploying Joomla sites with GITDeploying Joomla sites with GIT
Deploying Joomla sites with GIT
Ashwin Date
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
Ashwin Date
 

More from Ashwin Date (11)

Building modern frontends for joomla
Building modern frontends for joomlaBuilding modern frontends for joomla
Building modern frontends for joomla
 
King of Fruits - Theme based Gamification
King of Fruits - Theme based GamificationKing of Fruits - Theme based Gamification
King of Fruits - Theme based Gamification
 
Angular frontends with joomla backend
Angular frontends with joomla backendAngular frontends with joomla backend
Angular frontends with joomla backend
 
Revolutionizing kids education using joomla
Revolutionizing kids education using joomlaRevolutionizing kids education using joomla
Revolutionizing kids education using joomla
 
Git basics
Git basicsGit basics
Git basics
 
Caching and Performance Improvememts in Joomla
Caching and Performance Improvememts in JoomlaCaching and Performance Improvememts in Joomla
Caching and Performance Improvememts in Joomla
 
Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014
 
10 things you are doing wrong in Joomla
10 things you are doing wrong in Joomla10 things you are doing wrong in Joomla
10 things you are doing wrong in Joomla
 
How Joomla powers one of the biggest grain warehouses in India
How Joomla powers one of the biggest grain warehouses in IndiaHow Joomla powers one of the biggest grain warehouses in India
How Joomla powers one of the biggest grain warehouses in India
 
Deploying Joomla sites with GIT
Deploying Joomla sites with GITDeploying Joomla sites with GIT
Deploying Joomla sites with GIT
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 

Joomla! Itemid amd routing explained

  • 2. Anatomy of a non-sef URL index.php?option=com_content&view=category&layout=blog&id=8&Itemid=103
  • 3. Itemid is king ! - Notice how you write Itemid (Capital I) - It’s the id (primary key) of the menu created - Modules are assigned to a menu, will show up when a link having the respective Itemid shows up - This means if you change the Itemid for any other link, a different set of modules will load. This is not desirable - If you leave out the Itemid, only modules set to show on ‘All’ pages will show
  • 4. SEF URLs Explained /index.php?option=com_content&view=category&layout=blog&id=8&Itemid=103 Changes to /news Also, /index.php?option=com_content&view=category&layout=blog&id=9&Itemid=104 Changes to /news/sports
  • 5. SEF URLs Explained /index.php?option=com_content&view=article&id=7&Itemid=103 Changes to /news/7-new-article-2 /index.php?option=com_content&view=article&id=10&Itemid=104 Changes to /news/sports/10-sports-article
  • 6. Building a Route - Use JRoute::_() to build a route. Pass a URL with an Itemid - Itemid creates the first section of the SEF URL - If the query params do not match menu entry query params - The first URL section is created from the menu Itemid. Say /news/sports - The querystring is passed to extension’s router to build the next part of the route, so it adds /10- sports-article - This is the right way to build SEF URLs
  • 7. Building a Route - without Itemid - For URLs without an Itemid, or an invalid Itemid eg: index.php?option=com_content&view=article&id=7 - JRoute makes this /component/com_content/article/?id=7 - This is the wrong way to build SEF URLs
  • 8. Itemid guessing - Since JRoute::_() needs an Itemid - Write a wrapper function, say JTRoute::_() that accepts a part of the URL and guesses the Itemid - Use this function everywhere to produce consistent URLs
  • 9. Thanks ! Ashwin Date | techjoomla.com | @coolbung