SlideShare une entreprise Scribd logo
1  sur  9
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

Contenu connexe

Similaire à Joomla! Itemid amd routing explained

Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend FrameworkJamie Hurst
 
Websphere Commerce SEO
Websphere Commerce SEOWebsphere Commerce SEO
Websphere Commerce SEOShinu Suresh
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
Drupal 8 for site builders
Drupal 8 for site buildersDrupal 8 for site builders
Drupal 8 for site buildersKim Pepper
 
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 Customizationrledwich
 
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 presentationAlice 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 projectAkshat Kumar
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NETMike Melusky
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading TemplateAndiNurkholis1
 
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 MvcAmit 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 StudyAnand Ramdeo
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Binu Paul
 

Similaire à 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
 
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
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7
 

Plus de Ashwin Date

Building modern frontends for joomla
Building modern frontends for joomlaBuilding modern frontends for joomla
Building modern frontends for joomlaAshwin Date
 
King of Fruits - Theme based Gamification
King of Fruits - Theme based GamificationKing of Fruits - Theme based Gamification
King of Fruits - Theme based GamificationAshwin Date
 
Angular frontends with joomla backend
Angular frontends with joomla backendAngular frontends with joomla backend
Angular frontends with joomla backendAshwin Date
 
Revolutionizing kids education using joomla
Revolutionizing kids education using joomlaRevolutionizing kids education using joomla
Revolutionizing kids education using joomlaAshwin Date
 
Caching and Performance Improvememts in Joomla
Caching and Performance Improvememts in JoomlaCaching and Performance Improvememts in Joomla
Caching and Performance Improvememts in JoomlaAshwin Date
 
Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014Joomla REST API - JoomlaDay Bangkok 2014
Joomla REST API - JoomlaDay Bangkok 2014Ashwin 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 JoomlaAshwin 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 IndiaAshwin Date
 
Deploying Joomla sites with GIT
Deploying Joomla sites with GITDeploying Joomla sites with GIT
Deploying Joomla sites with GITAshwin Date
 

Plus de 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
 

Dernier

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Dernier (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

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