Learning Joomla! 3 Extension Development-Third Edition


Learning Joomla! 3 Extension Development-Third Edition
eBook: $32.99
Formats: PDF, PacktLib, ePub and Mobi formats
$26.39
save 20%!
Print + free eBook + free PacktLib access to the book: $87.98    Print cover: $54.99
$54.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • 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

Book Details

Language : English
Paperback : 458 pages [ 235mm x 191mm ]
Release Date : July 2013
ISBN : 1782168370
ISBN 13 : 9781782168379
Author(s) : Tim Plummer
Topics and Technologies : All Books, CMS and eCommerce, Content Management (CMS), Joomla!, Open Source

Table of Contents

Preface
Chapter 1: Before you Start
Chapter 2: Getting Started with Plugin Development
Chapter 3: Getting Started with Module Development
Chapter 4: Getting Started with Component Development
Chapter 5: Backend Component Development – Part 1
Chapter 6: Backend Component Development – Part 2
Chapter 7: Frontend Component Development
Chapter 8: Security – Avoiding Common Vulnerabilities
Chapter 9: Packing Everything Together
Chapter 10: Extending your Component with Plugins and Modules
Index
  • Chapter 1: Before you Start
    • Extension types and their uses
      • Plugins
      • Modules
      • Components
      • Languages
      • Templates
      • Libraries
      • Packages
    • Joomla! versions that your extensions should support
      • What's new in Joomla! 3
    • Licensing and GPL
    • What business model should I adopt?
    • Tools you need to develop the Joomla! extensions
    • Coding standards
    • Legacy MVC versus new MVC
    • Upgrading a Joomla! 2.5 component to make it Joomla! 3 compatible
    • To fork or not to fork?
    • Summary
    • Chapter 2: Getting Started with Plugin Development
      • Plugin types
      • Plugin event triggers
      • Where do I start?
      • Creating the installation XML file
      • Creating the plugin PHP file
      • Zip it up and install your plugin
      • Adding the parameters to our plugin
      • Adding the language files
      • Summary
      • Chapter 3: Getting Started with Module Development
        • Where do I start?
        • Backend versus frontend modules
          • Backend modules' installation location
          • Frontend modules' installation location
        • Creating the installation XML file
        • Creating the module PHP file
        • Creating the view
        • Connecting to the database
        • Zip it up and install your module
          • Packaging your module for distribution
        • Backwards compatibility for Joomla! 2.5
          • Making changes to the installation XML file
          • Adding the CSS styles
          • Packaging for distribution
        • Converting to the site module
        • Translating your module
        • Adding a help file
        • Template overrides
          • Watch out when updating
          • Alternative layouts
        • Making your module responsive
        • Summary
        • Chapter 4: Getting Started with Component Development
          • Where do I start?
          • Creating the component installation XML file
          • Creating a simple component
            • Creating the entry point
            • Creating the access XML file
            • Creating the config XML file
          • Setting up the database
            • Discover the extension
            • Creating the controllers
            • Creating the model for the list view
            • Creating the model for the edit view
          • Creating a form
            • The form XML file
            • JForm field types
              • Accesslevel
              • Cachehandler
              • Calendar
              • Captcha
              • Category
              • Checkbox
              • Checkboxes
              • Chromestyle
              • Color
              • Combo
              • Componentlayout
              • Contentlanguage
              • Contenttype
              • Databaseconnection
              • Editor
              • Email
              • File
              • Filelist
              • Folderlist
              • Groupedlist
              • Headertag
              • Helpsite
              • Hidden
              • Imagelist
              • Integer
              • Language
              • List
              • Media
              • Menu
              • Menuitem
              • Modulelayout
              • Moduleorder
              • Moduleposition
              • Moduletag
              • Password
              • Plugins
              • Radio
              • Rules
              • Sessionhandler
              • Spacer
              • Sql
              • Tag
              • Tagnested
              • Tel
              • Templatestyle
              • Text
              • Textarea
              • Timezone
              • Url
              • User
              • Usergroup
          • Creating a view
            • The list view
              • The view.html.php file
              • The helper file
              • The view layout file
            • The edit view
              • The view.html.php file
              • The view layout file
          • Installer script
          • Zip it up and install your component
          • Summary
          • Chapter 5: Backend Component Development – Part 1
            • Adding additional fields
              • Adding fields to the model
                • Category field
                • State field
                • Media field
                • Company field
                • Phone field
                • URL field
                • Description field
                • Language strings for new fields
              • Adding fields to the view
              • Alternative method for displaying fields in the view
              • Adding fields to the database
            • Adding columns to your view
              • Adding simple columns
              • Click to sort by column
              • Status column
              • Ordering column
            • Toolbar buttons and component options
              • Component options
            • View filters and search
              • Sidebar filters
              • Changing delete to trash
              • Filters and search
            • Summary
            • Chapter 6: Backend Component Development – Part 2
              • Pagination
              • Adding views and submenu items
                • The categories view
                • The preview view
                • Submenus
              • Access Control List (ACL)
                • Global permissions
                • Component permissions
                • Category permissions
                • Article permissions
                • Access level
              • Multi-database support
              • Summary
              • Chapter 7: Frontend Component Development
                • Getting started on the frontend
                • Creating a view
                • Adding CSS
                • Adding sample images
                • Creating another view
                • Menu item parameters
                  • Adding a category filter on our menu
                  • Using component options
                  • Width and height parameters
                • Translating your component
                • Updating data from the frontend
                  • Creating the list view
                  • Creating the edit form
                • Using ReCaptcha in your component
                  • ReCaptcha without JForm
                • Using our click-to-call plugin with this component
                • Integrating a third-party comments extension
                • Summary

                      Tim Plummer

                      Tim Plummer is a Joomla! enthusiast and extension developer who has been building websites for over ten years, and specializing in Joomla! since 2008. Tim has developed and maintained several popular components, modules, and plugins, which are listed on the Joomla! Extension Directory, in addition to his day job in IT for a multinational manufacturer. Tim lives in Sydney, Australia, with his wife, Tamlyn, who runs her own design agency and two kids, Zane and Ava-Lily, who keep Tim very busy. At university Tim studied Engineering, and he has a Bachelor of Engineering in Telecommunications Engineering degree, however his passion in IT has been his career focus.

                      Tim is very active in the Joomla! community; in January 2012 Tim took on the convener role for the Sydney Joomla! User Group (JUG), and he has been coorganizer for the annual Joomla!Day Sydney conference since 2011, taking on the coordinator role in 2013. Tim has run Joomla! development workshops at Joomla! Day conferences and various JUG groups throughout Australia, and is a regular presenter at the Sydney JUG.

                      Sorry, we don't have any reviews for this title yet.

                      Code Downloads

                      Download the code and support files for this book.


                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                      Errata

                      - 11 submitted: last submission 01 Jul 2014

                      Errata type: Typo | Page number: 173

                      On page 173, the last line on the fourth paragraph has a typo. It currently reads as follows:

                      "Since our component doesn't have any other views, it's not really an issue yet, but later on when we add more views it would be come a problem."

                       

                      The correct one is as follows (the change has been highlighted):

                      "Since our component doesn't have any other views, it's not really an issue yet, but later on when we add more views it would become a problem."

                       

                      Errata type: Technical | Page number: 119  - 120

                      The bullet list that starts at page 119 and ends on page 120 has to have one more item in it. It is as follows:

                       

                      • controller.php

                       

                      Consider the above item as the last bullet item in the list.

                      Errata type: Typo | Page number: 113

                      On page 113, the first line reads "As usual, we start with define or die, so this PHP file can't be executed directly." This is incorrect.

                      The correct one is as follows (change has been highlighted):

                      "As usual, we start with defined or die, so this PHP file can't be executed directly. "

                       

                      Errata type: Code | Page number: 127

                      On page 127, the first line under the Creating the model for the edit view section reads as follows:

                      "Create  another file /administrator/components/com_folio/folio.php, which will be the model used for our edit view:"

                       

                      This is incorrect, the correct one is as follows (change has been highlighted):

                      "Create another file /administrator/components/com_folio/models/folio.php, which will be the model used for our edit view:"

                       

                       

                      Errata type: Language | Page number: 169

                      On page 169, the the last paragraph reads "After displaying the column titles, we look through the data in the $this->items....."

                       

                      A better rewording would be as follows (the change has been highlighted):

                      "After displaying the column titles, we loop through the data in the $this->items....."

                      Errata type: Typo | Page number: 120

                       

                      On page 120, the lead-in sentence for the steps reads : 

                      "Now perform the following these steps to install your component:"

                       

                      This is grammatically incorrect, the correct one is as follows (the change has been highlighted):

                      "Now perform the following steps to install your component:"

                       


                      Errata type: Typo | Page number: 219

                       

                      On page 219, the first line reads

                      "We have just added the ordering field to the selections in the _construct? and the getListQuery functions"

                       

                      This is incorrect, the correct one is as follows (the change has been highlighted):

                      "We have just added the ordering field to the selections in the _construct and the getListQuery functions"

                      Errata type: Technical | Page number: 220

                       

                      There was a version update for Joomla! after the book was written. Hence the following content needs to be added on page 120 after the first paragraph:

                      "In Joomla 3.1.4 which was released in July 2013, the saveOrderAjax function was moved to /libraries/legacy/controller/admin.php, and removed from all the component’s controller files such as com_weblinks. It is no longer necessary to include this function in your component, unless you wish to support Joomla 3.0 - 3.1.1 versions. Note that 3.1.2 and 3.1.3 had packaging issues so these versions were skipped, and the Joomla project went straight from 3.1.1 to 3.1.4."

                      Errata type: Layout | Page number: 240

                       

                      The fifth line of code on page 240 shouls be highlighted as it is new code that is inserted. The line of code to be highlighted is as follows:

                      $this->pagination = $this->get('Pagination');

                      Errata type: Code | Page number: 189

                       

                      On page 189, the code from lines 7-10 have to be changed. The existent code is as follows:

                      <div class="control-label"><?php echo $this->form->getLabel('published'); ?></div>

                       

                      <div class="controls"><?php echo $this->form->getInput('published'); ?></div>

                       

                      This should be replaced by the following:

                      <div class="control-label"><?php echo $this->form->getLabel('state'); ?></div>

                       

                      <div class="controls"><?php echo $this->form->getInput('state'); ?></div>

                      Errata type: Typo | Page number: 132

                       

                      The third paragraph of page 132 should read (the correction is highlighted) "The alias field is similar to the title field, however this is not a mandatory field so there is no input required."


                       

                       

                      Errata Type: Support Query

                      On page 117:

                      \administrator\components\com_folio\language\en-GB\en-GB.com_folio.ini  should be \administrator\components\com_folio\language\en-GB\en-GB.com_folio.*sys*.ini

                       

                      On page 293, the populateState function should also be in bold, as follows:

                           protected function populateState($ordering = null, $direction = null)

                                      {

                                               $id = JRequest::getInt('id');

                                                      $this->setState('id', $id);

                       

                                      }


                      On page 297:

                      In the line of code 'ordering', 'a.ordering', 'a.catid'    - a.catid is unnecessary. so the revised code should be as follows:

                      'ordering', 'a.ordering'

                       

                      On page 298:

                      In the line of code 'a.phone, a.description, a.catid'       - a.catid is unnecessary, so the revised code should be as follows:

                      'a.phone, a.description'

                       

                      Information: while working with page 331please note that the Komento installation package is large (over 2MB), and some users may need to use the install from directory option.

                       

                      On page 339:

                      The second code snippet has a line of code that reads if (class_exists('plgContentKomento')). Since we don’t have any calls to content.prepare, we are not loading the content plugins, so the plgContentKomento class will never exist. A better approach would be to look for the system plugin plgSystemKomento, as this will always load on the page regardless of whether we are loading any content plugins or not. Hence the code should look like the following:

                      if (class_exists('plgSystemKomento'))

                       

                      On Page 413:

                      The second-last line of code shows client="administrator", but rather client="site" would be more appropriate.

                       

                      On Page 420:

                      For Joomla 3.1.2 or greater, from the weblink.xml file, we should remove

                      <fields name="metadata">

                                                      <fieldset name="jmetadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">

                                                                      <field name="tags" type="tag"

                                                                                      label="JTAG" description="JTAG_DESC"

                                                                                      class="inputbox" multiple="true"

                                                                      >

                                                                      </field>

                                                      </fieldset>

                       

                                      </fields>


                      And add to the “myfields” fieldset, the following

                       

                                                      <field name="tags"

                                                                      type="tag"

                                                                      label="JTAG"

                                                                      description="JTAG_DESC"

                                                                      multiple="true">

                       

                                                      </field>

                       

                      On pages 429 and 430, the loactions of the files are updated as follows:

                      view.html.php is found under com_folio_v2.10.0\admin\views\folios

                      default.php is found under com_folio_v2.10.0\admin\views\folios\tmpl

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      Learning Joomla! 3 Extension Development-Third Edition +    IBM Cognos Business Intelligence =
                      50% Off
                      the second eBook
                      Price for both: €38.50

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • Extend Joomla using plugins
                      • Develop both frontend and backend modules
                      • Build a Joomla component that looks and behaves like the core components, to reduce the learning curve for your users
                      • Discover common security vulnerabilities and what you can do to avoid them
                      • Prepare your extensions for distribution
                      • Manage updates and set up an update server
                      • Integrate third party extensions in your component

                      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.

                      Approach

                      A practical guide with step-by-step examples that build on each other so you can learn by doing and get hands-on knowledge about creating your plugins, modules, and components in Joomla.

                      Who this book is for

                      "Learning Joomla! 3 Extension Development" is for developers who want to create their own Joomla extensions. It is assumed you will have some basic PHP, HTML, and CSS knowledge, but you don’t need any prior Joomla programming experience. This book will also be useful to people who just want to make minor customizations to existing Joomla extensions and build on the work of others in the open source spirit.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Resources
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software