Learning Joomla! 3 Extension Development-Third Edition
|Also available on:|
- 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 DetailsLanguage : 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 ContentsPreface
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
- Chapter 1: Before you Start
- Extension types and their uses
- 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?
- 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
- 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
- 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
- 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
- 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
- Chapter 6: Backend Component Development – Part 2
- Adding views and submenu items
- The categories view
- The preview view
- Access Control List (ACL)
- Global permissions
- Component permissions
- Category permissions
- Article permissions
- Access level
- Multi-database support
- 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
- Chapter 8: Security – Avoiding Common Vulnerabilities
- Why you should care about security
- Path disclosure
- SQL injection
- Local File Inclusion
- Remote File Inclusion
- Cross-site scripting
- Cross-site Request Forgery
- Some quick advice
- Chapter 9: Packing Everything Together
- Creating a package
- Setting up an update server
- Managing database changes
- Updating the PHP files
- Getting listed on the JED
- Chapter 10: Extending your Component with Plugins and Modules
- Creating a search plugin
- Creating a smart search plugin
- Creating a featured portfolio module
- Adding tags to our component
Download the code and support files for this book.
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:
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');
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:
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:
Information: while working with page 331, please 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:
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
<fieldset name="jmetadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<field name="tags" type="tag"
And add to the “myfields” fieldset, the following
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
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
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.
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.