Joomla! is an award-winning content management system with a powerful extension system. This makes it easy for third-party developers to build code extending Joomla’s core functionality without hacking or modifying the core code.
Once an extension is developed, it can be packaged into a ZIP file for site administrators to upload and use. The people who manage Joomla!-based websites and want to use extensions need not know any programming at all. Once the ZIP file is uploaded, the extension is installed.
The name Joomla! comes from the Swahili word ‘jumla’, meaning “all together” or “as a whole”. When you install an extension in Joomla!, it blends in with the rest of the site; all the extensions truly appear “all together, as a whole”.
Chapter 1 gives an overview of how Joomla! works. The example project used throughout the book is also introduced. The three types of extensions (components, modules, and plug-ins) are covered along with descriptions of how they work together.
Chapter 2 begins the development of the component used in the project. Initial entries are made in the database and toolbars for the back end are built. The general file structure of Joomla! is also introduced.
Chapter 3 walks through the creation of the back-end interface for creating, editing, and deleting records in the project. Database table classes are introduced, as well as common HTML elements used to make the project blend in with other Joomla! extensions.
Chapter 4 builds a front-end interface for listing and viewing records. Additionally, code to generate and interpret search-engine-friendly links is covered. The project is also expanded slightly when a commenting feature is added.
Chapter 5 introduces a module used to list records on every page of the site. The module takes advantage of layouts, where the same data can be formatted differently depending on how the code is called. Some of the code is also separated out into a helper class so that the main code generating the module stays simple.
Chapter 6 rewrites the component developed in Chapters 2, 3, and 4 so that it follows the Model, View, Controller design pattern. Controls over the publishing of records are introduced, in addition to an interface for removing offensive comments. More toolbars are added and the search-engine-friendly URL code is redesigned.
Chapter 7 develops three plug-ins. The first plug-in finds the names of records in the database and turns them in to links to those records. A second plug-in displays a short summary of the record when certain code is added to content articles. Finally, another plug-in is designed so that records are pulled up along with Joomla! content searches.
Chapter 8 adds configuration parameters to the component, module, and plug-ins. These are handled through XML and generate a predictable interface in the back end for setting options. Retrieving the values of these parameters is standardized through built-in functions.
Chapter 9 expands the XML files used for parameters and adds a listing of all the files in each extension. Once this file is compressed along with the rest of the code into a ZIP archive, it is ready to be installed on another copy of Joomla! without any programmer intervention. Custom installation scripts and SQL code are also added to the component.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
There are three styles for code. Code words in text are shown as follows: “We can include other contexts through the use of the include
directive.”
A block of code will be set as follows:
function showReviews( $option ) { $query = "SELECT * FROM #__reviews"; $db->setQuery( $query ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:
switch($task) { case 'add': editReview( $option ); break; case 'save': saveReview( $option ); break; }
Any command-line input and output is written as follows:
INSERT INTO jos_components (name, link, admin_menu_link, admin_menu_alt, `option`, admin_menu_img, params)
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: “clicking the Next button moves you to the next screen”.
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to <[email protected]>
, making sure to mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at <[email protected]>
if you are having a problem with some aspect of the book, and we will do our best to address it.