O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Joomla! 3 Extension Development - Third Edition

Book Description

If you have ideas for additional Joomla 3! features, this book will allow you to realize them. It’s a complete practical guide to building and extending plugins, modules, and components. Ideal for professional developers and enthusiasts.

  • Clear steps to create your own plugins, modules, and components for Joomla 3
  • Guides you through extending your components by allowing them to interact with modules and plugins
  • Introduces you to packaging your extensions for distribution to other Joomla users
  • Enables you to secure your extensions and avoid common vulnerabilities by gaining some white hat hacking experience

In Detail

Joomla 3 is the first of the major open source content management systems that was meant to be mobile friendly by default. Joomla uses object-oriented principles, is database agnostic, and has the best mix of functionality, extensibility, and user friendliness. Add to that the fact that Joomla is completely community driven, and you have a winning combination that is available to everyone, and is the perfect platform to build your own custom applications.

"Learning Joomla! 3 Extension Development" is an integrated series of practical, hands-on tutorials that guide you through building and extending Joomla plugins, modules, and components. With Joomla having been downloaded well over 35 million times, there is a huge market for Joomla extensions, so you could potentially earn some extra cash in your spare time using your newly acquired Joomla extension development skills.

We will start with developing simple plugins and modules, and then progress to more complex backend and frontend component development. Then we will try our hand at ethical hacking, so you will learn about common security vulnerabilities and what you can do to avoid them. After that we will look at how you can prepare your extensions for distribution and updates, as well as how you can extend your components with various plugins and modules. Finally, you will end up with a fully functioning package of extensions that you can use on your own site or share with others.

If you want to build your own custom applications in Joomla, then "Learning Joomla! 3 Extension Development" will teach you everything you need to know in a practical, hands-on manner.

Table of Contents

  1. Learning Joomla! 3 Extension Development - Third Edition
    1. Table of Contents
    2. Learning Joomla! 3 Extension Development - Third Edition
    3. Credits
    4. About the Author
    5. Acknowledgement
    6. About the Reviewers
    7. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
      2. Why subscribe?
      3. Free access for Packt account holders
    8. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    9. 1. Before you Start
      1. Extension types and their uses
        1. Plugins
        2. Modules
        3. Components
        4. Languages
        5. Templates
        6. Libraries
        7. Packages
      2. Joomla! versions that your extensions should support
        1. What's new in Joomla! 3
      3. Licensing and GPL
      4. What business model should I adopt?
      5. Tools you need to develop the Joomla! extensions
      6. Coding standards
      7. Legacy MVC versus new MVC
      8. Upgrading a Joomla! 2.5 component to make it Joomla! 3 compatible
      9. To fork or not to fork?
      10. Summary
    10. 2. Getting Started with Plugin Development
      1. Plugin types
      2. Plugin event triggers
      3. Where do I start?
      4. Creating the installation XML file
      5. Creating the plugin PHP file
      6. Zip it up and install your plugin
      7. Adding the parameters to our plugin
      8. Adding the language files
      9. Summary
    11. 3. Getting Started with Module Development
      1. Where do I start?
      2. Backend versus frontend modules
        1. Backend modules' installation location
        2. Frontend modules' installation location
      3. Creating the installation XML file
      4. Creating the module PHP file
      5. Creating the view
      6. Connecting to the database
      7. Zip it up and install your module
        1. Packaging your module for distribution
      8. Backwards compatibility for Joomla! 2.5
        1. Making changes to the installation XML file
        2. Adding the CSS styles
        3. Packaging for distribution
      9. Converting to the site module
      10. Translating your module
      11. Adding a help file
      12. Template overrides
        1. Watch out when updating
        2. Alternative layouts
      13. Making your module responsive
      14. Summary
    12. 4. Getting Started with Component Development
      1. Where do I start?
      2. Creating the component installation XML file
      3. Creating a simple component
        1. Creating the entry point
        2. Creating the access XML file
        3. Creating the config XML file
      4. Setting up the database
        1. Discover the extension
        2. Creating the controllers
        3. Creating the model for the list view
        4. Creating the model for the edit view
      5. Creating a form
        1. The form XML file
        2. JForm field types
          1. Accesslevel
          2. Cachehandler
          3. Calendar
          4. Captcha
          5. Category
          6. Checkbox
          7. Checkboxes
          8. Chromestyle
          9. Color
          10. Combo
          11. Componentlayout
          12. Contentlanguage
          13. Contenttype
          14. Databaseconnection
          15. Editor
          16. Email
          17. File
          18. Filelist
          19. Folderlist
          20. Groupedlist
          21. Headertag
          22. Helpsite
          23. Hidden
          24. Imagelist
          25. Integer
          26. Language
          27. List
          28. Media
          29. Menu
          30. Menuitem
          31. Modulelayout
          32. Moduleorder
          33. Moduleposition
          34. Moduletag
          35. Password
          36. Plugins
          37. Radio
          38. Rules
          39. Sessionhandler
          40. Spacer
          41. Sql
          42. Tag
          43. Tagnested
          44. Tel
          45. Templatestyle
          46. Text
          47. Textarea
          48. Timezone
          49. Url
          50. User
          51. Usergroup
      6. Creating a view
        1. The list view
          1. The view.html.php file
          2. The helper file
          3. The view layout file
        2. The edit view
          1. The view.html.php file
          2. The view layout file
      7. Installer script
      8. Zip it up and install your component
      9. Summary
    13. 5. Backend Component Development – Part 1
      1. Adding additional fields
        1. Adding fields to the model
          1. Category field
          2. State field
          3. Media field
          4. Company field
          5. Phone field
          6. URL field
          7. Description field
          8. Language strings for new fields
        2. Adding fields to the view
        3. Alternative method for displaying fields in the view
        4. Adding fields to the database
      2. Adding columns to your view
        1. Adding simple columns
        2. Click to sort by column
        3. Status column
        4. Ordering column
      3. Toolbar buttons and component options
        1. Component options
      4. View filters and search
        1. Sidebar filters
        2. Changing delete to trash
        3. Filters and search
      5. Summary
    14. 6. Backend Component Development – Part 2
      1. Pagination
      2. Adding views and submenu items
        1. The categories view
        2. The preview view
        3. Submenus
      3. Access Control List (ACL)
        1. Global permissions
        2. Component permissions
        3. Category permissions
        4. Article permissions
        5. Access level
      4. Multi-database support
      5. Summary
    15. 7. Frontend Component Development
      1. Getting started on the frontend
      2. Creating a view
      3. Adding CSS
      4. Adding sample images
      5. Creating another view
      6. Menu item parameters
        1. Adding a category filter on our menu
        2. Using component options
        3. Width and height parameters
      7. Translating your component
      8. Updating data from the frontend
        1. Creating the list view
        2. Creating the edit form
      9. Using ReCaptcha in your component
        1. ReCaptcha without JForm
      10. Using our click-to-call plugin with this component
      11. Integrating a third-party comments extension
      12. Summary
    16. 8. Security – Avoiding Common Vulnerabilities
      1. Why you should care about security
      2. Path disclosure
      3. SQL injection
      4. Local File Inclusion
      5. Remote File Inclusion
      6. Cross-site scripting
      7. Cross-site Request Forgery
      8. Some quick advice
      9. Summary
    17. 9. Packing Everything Together
      1. Creating a package
      2. Setting up an update server
      3. Managing database changes
        1. Updating the PHP files
      4. Getting listed on the JED
      5. Summary
    18. 10. Extending your Component with Plugins and Modules
      1. Creating a search plugin
      2. Creating a smart search plugin
      3. Creating a featured portfolio module
      4. Adding tags to our component
      5. Summary
    19. Index