SlideShare a Scribd company logo
1 of 49
Hacking Joomla
  The rightway


By Chad Windnagle
Who Am I?

• Lead Developer at s-go Consulting
• Joomla Expert
• Joomla Google Summer of Code Co-
    Admin
•   Motorcycle Enthusiast
•   College Student
Why You Care


•   Consistent Layout
•   HTML5
•   Mobile
•   Custom Tailored For You
Important concepts

•   The Rule
•   The reason
•   The exception
•   Language Overrides
•   Layout Overrides
The rule



    "Don't hack Joomla."

 (includes core extensions
 and non-core extensions!)
Why




      It kills puppies
Why




      and kittens
Everything is bigger in Texas?
Not if you break the rules
Seriously...it's bad

Hacking Core Code Causes:
• Security Vulnerabilities

• Update Nightmares

• No longer Feature / Future Proof

• Normal sized foods
The exception



 There are times when you
  can modify code without
   killing our four legged
            friends
It's not hard




Joomla 1.5 and Joomla 2.5
   made changing things
 correctly a very easy task.
Several "approved" methods:

Two ways to 'hack'
  Joomla, properly
1. Language Override

2. Template Override
Language Overrides: Really cool
Joomla 2.5 Feature




Joomla's language manager allows you
 to search, find, and override language
                constants.
What are language constants?

Language constants are text strings, a
     lot like variables, with a value
   assigned them. They areused in
      components, modules, and
 plugins, and their purpose isto make
  development and translation easier.
Changing a language constant




before...
Changing a language constant




after...
One more time…




before...
Changing a language constant




after...
Let's try it out...




              {Live Demo}
Important concepts

•   The Rule
•   The reason
•   The exception
•   Language Overrides
•   Layout Overrides
Template Layout Override


Template overrides allow you
 to store copies of view files
       in your template
 directory, and change them
          as needed.
Template Layout Override



Joomla will load any template
  views in priority over views
     in an extensions view
           directory.
Typical Component File System




 We can only override VIEW files
Understand the directory structure
We copy files from:
<joomla>components/com_content/views/featured/tmpl

and put them in:
<joomla>/templates/atomic/html/com_content/featured
Compare...
What happened?

Joomla will check the loaded
    template for any installed
  components and views. If it
 finds a match, it will load the
 file in the template, and skip
          the component.
What happens...a visual




   Joomla! loads these files




    Joomla skips these files
Result




We can now make changes to the files
in template that will load instead of the
      component's included files.
Try it out




             {Live Demo}
Remember


• Only views can be overridden
• If the html directory doesn’t
  exist, you can create it.
• Joomla will ‘know’
• If it doesn’t work, you probably
  misspelled something
Important concepts

•   The Rule
•   The reason
•   The exception
•   Language Overrides
•   Layout Overrides
Bonus features

•   The Rule
•   The reason
•   The exception
•   Language Overrides
•   Layout Overrides
•   Module Chrome
In template html add modules.php

Add this function:
function
   modChrome_name($module, &$params, &$a
   ttribs) {
  echo $module->title;
  echo $module->content;
}
In template index.php

Check out jdoc for modules
<jdoc:include type="modules" name="atomic-
  bottomleft" style="name" />
Match it up




See that modChrome_name and the module
include uses the style name.
What does it mean?




We can now add any HTML or PHP
 code to modules.php which can
  change how module content is
    presented in the template.
We will attempt this...




            {Live Demo}
Bonus features

•   The Rule
•   The reason
•   The exception
•   Language Overrides
•   Layout Overrides
•   Module Chrome
Basic non-Joomla concept



    CSS styles can be
    overwritten by using
  cascading order selection
        statements.
Cascading order in CSS

CSS Code:
p {color:black;font-size:100%}
  div.intro p {color:white;font-size:200%}
HTML code:
  <p>A paragraph with black text</p>
  <div class="intro">
   <p>paragraph witwhite text</p>
</div>
In Joomla...
Cascading order in CSS



Instead of changing redshop.css, I can
    add to my template css a ordered
   selection to change ('override') css
                  styles.
Cascading order in CSS




By simply adding an ordered css statement, we
override the component's css file with our own.
Cascading order in CSS




          {Live Demo}
New rule




  Don't change core code.
  This includes CSS files!
Conclusion



•Use the language manager to
make your site fit you.

•Use template overrides to
make all your components
consistent and user friendly.
Conclusion



•Use modules.php to add cool
features to all your modules.
Contact me


      Chad Windnagle
      s-go Consulting
          s-go.net
      chad@s-go.net
        @drmmr763

More Related Content

What's hot

Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
 
WDIM268 Week 2 (Summer 2010)
WDIM268 Week 2 (Summer 2010)WDIM268 Week 2 (Summer 2010)
WDIM268 Week 2 (Summer 2010)
Tyler Sticka
 
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samplesUsing Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Rashad Aliyev
 

What's hot (20)

HTML BY JODY C SALAS
HTML BY JODY C SALAS HTML BY JODY C SALAS
HTML BY JODY C SALAS
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
 
WDIM268 Week 2 (Summer 2010)
WDIM268 Week 2 (Summer 2010)WDIM268 Week 2 (Summer 2010)
WDIM268 Week 2 (Summer 2010)
 
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
 
JSP Part 1
JSP Part 1JSP Part 1
JSP Part 1
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Week 2 html
Week 2   htmlWeek 2   html
Week 2 html
 
Ashish
AshishAshish
Ashish
 
The web context
The web contextThe web context
The web context
 
Khoa dang (kay)
Khoa dang (kay)Khoa dang (kay)
Khoa dang (kay)
 
Html
HtmlHtml
Html
 
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samplesUsing Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
 
HTML+CSS: how to get started
HTML+CSS: how to get startedHTML+CSS: how to get started
HTML+CSS: how to get started
 
HTML Lesson 5
HTML Lesson 5HTML Lesson 5
HTML Lesson 5
 
HTML for absolutely begginers
HTML for absolutely begginersHTML for absolutely begginers
HTML for absolutely begginers
 
BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)
 
HTML Lesson 1
HTML Lesson 1HTML Lesson 1
HTML Lesson 1
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public Release
 

Viewers also liked (11)

Template Layout Overrides - a beginner's guide
Template Layout Overrides - a beginner's guideTemplate Layout Overrides - a beginner's guide
Template Layout Overrides - a beginner's guide
 
19. commission
19. commission19. commission
19. commission
 
Commission
CommissionCommission
Commission
 
Khadi & Village Industries Commission
Khadi & Village Industries CommissionKhadi & Village Industries Commission
Khadi & Village Industries Commission
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Types Of Commission
Types Of CommissionTypes Of Commission
Types Of Commission
 
Business math
Business mathBusiness math
Business math
 
Business Math Chapter 5
Business Math Chapter 5 Business Math Chapter 5
Business Math Chapter 5
 
Business Math Chapter 6
Business Math Chapter 6Business Math Chapter 6
Business Math Chapter 6
 
Business Math Chapter 1
Business Math Chapter 1Business Math Chapter 1
Business Math Chapter 1
 
Chapter 12_The Mortgage Markets
Chapter 12_The Mortgage MarketsChapter 12_The Mortgage Markets
Chapter 12_The Mortgage Markets
 

Similar to Template overrides austin

Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
Vishwash Gaur
 
Joomla templates2011
Joomla templates2011Joomla templates2011
Joomla templates2011
Linda Coonen
 
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
 
Joomla Creative Inside Joomla Templates And Design
Joomla Creative   Inside Joomla Templates And DesignJoomla Creative   Inside Joomla Templates And Design
Joomla Creative Inside Joomla Templates And Design
joomladex
 

Similar to Template overrides austin (20)

How to customise Joomla
How to customise JoomlaHow to customise Joomla
How to customise Joomla
 
Joomla Templates101
Joomla Templates101Joomla Templates101
Joomla Templates101
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
 
Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
Joomla templates2011
Joomla templates2011Joomla templates2011
Joomla templates2011
 
Miami2015
Miami2015Miami2015
Miami2015
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
Developing joomla 1.6 templates
Developing joomla 1.6 templatesDeveloping joomla 1.6 templates
Developing joomla 1.6 templates
 
presentation
presentationpresentation
presentation
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
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
 
Joomla Creative Inside Joomla Templates And Design
Joomla Creative   Inside Joomla Templates And DesignJoomla Creative   Inside Joomla Templates And Design
Joomla Creative Inside Joomla Templates And Design
 
The Drupal 7 Worst Practices Catalogue
The Drupal 7 Worst Practices CatalogueThe Drupal 7 Worst Practices Catalogue
The Drupal 7 Worst Practices Catalogue
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
 
Developing Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, ExplainedDeveloping Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, Explained
 
Web components, so close!
Web components, so close!Web components, so close!
Web components, so close!
 

More from Chad Windnagle

More from Chad Windnagle (8)

Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017
 
Get queued
Get queuedGet queued
Get queued
 
Good dev citizen
Good dev citizenGood dev citizen
Good dev citizen
 
May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014
 
Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12
 
Joomla Essential Extensions
Joomla Essential ExtensionsJoomla Essential Extensions
Joomla Essential Extensions
 
Getting Involved in the Joomla Community
Getting Involved in the Joomla CommunityGetting Involved in the Joomla Community
Getting Involved in the Joomla Community
 
Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Template overrides austin