Joomla! 1.5 Development Cookbook
Sparky Anduril writes "In Joomla! 1.5 Development Cookbook James Kennard has written an accessible and easy-to-read book to help anyone who is writing (or plans to write) extensions for the popular open source content management system, Joomla! (specifically for version 1.5). It is available as a paperback or PDF eBook." Read on for the rest of Jonathan's review.
Joomla! 1.5 Development Cookbook
author
James Kennard
pages
360
publisher
Packt Publishing
rating
9
reviewer
Jonathan West
ISBN
978-1-847198-14-3
summary
Recipes for developing extensions with Joomla! 1.5
This is not an introduction to writing extensions for Joomla! For example, it does not describe the architecture of extensions, nor does it suggest how you should go about designing or developing extensions. The book does not claim to do this and you will need to look elsewhere if you need introductory material on that subject.
What this book does provide however is a number of "recipes" that developers can use to solve common problems when developing extensions for Joomla! As such it is a very useful resource that can be used in two ways: the inexperienced developer will want to read through the entire book chapter by chapter, to understand the issues they will need to consider. The more experienced developer will want to use this book as a reference book, dipping in when they encounter a particular problem or face a particular task.
The first thing to say is that (perhaps unusually for a software developer) James can write! His English is clear and I cannot imagine anyone having any complaints about his grammar. This means that despite being a technical reference the book is a pleasure to read.
Each recipe is laid out in the same format (as you would expect from any good cookbook!) The title of the recipe is followed by an explanation of the problem or task. "Getting ready" lays out what you must do before getting to the body of the recipe. "How to do it..." is laid out as a set of code statements with a brief explanation. "How it works..." provides more explanation on why to do what the recipe says, often accompanied by example data. "There's more..." lays out additional things to consider, perhaps more you can do with the recipe or alternative ways of achieving the same end. Where they are alternatives, James is generally very careful to explain the pros and cons of each approach. "See also" provides a cross-reference to related recipes in the book.
The first chapter is an essential introduction to getting involved in the Joomla! open source community through JoomlaCode.org. James explains how to create a new project and manage that project. The chapter concludes by explaining the use of TortoiseSVN for managing the source code of your project. I found that the explanation of the top-level folder structure and the use of branches within SVN was particularly illuminating.
The next two chapters provide further general background: chapter two provides recipes to ensure your extensions remain secure and chapter three describes how to work with the database. While James does not explain the underlying security issues (e.g. he does not describe what SQL injection is and why it may comprise security), the recipes provided (that address keeping your SQL safe, ensuring filenames and folders are safe and that you ensure that request data does not pose a threat) are easy to follow and I was able to work out why they should be used. The chapter on Working with the Database explains how to construct and execute SQL queries and the use of the Joomla!-specific JTable object. While I am familiar with working with SQL, this chapter was an eye-opener to me as it shows very clearly how working with the database under the Joomla! framework is different from conventional approaches, and how the JTable object makes it very easy to manipulate the database.
The remaining chapters of the book each focus in on a particular area. James covers the following topics: "The Session and the User", "Multilingual Recipes", "Interaction and Styling", "Customizing the Document", "Customizing the Backend", "Keeping it Extensible and Modular", "JObjects and Arrays", "Error Handling and Reporting", "Files and Folders".
The range of topics covered is such that it will ensure you at least think about some issues that otherwise may never have crossed your mind. For example, you may not have considered it necessary to make your extension available in other languages, but in the chapter on "Multilingual Recipes" James shows that it is incredibly easy to make your extension language-aware, so even if you're not going to provide a Slovakian or Sanskrit translation you can at least ensure that your extension will support those languages (should someone out there want to do the translation work for you — which is often what happens with Joomla! extensions).
A brief summary of the content of each chapter, with a few highlights picked out, follows:
"The Session and the User": recipes cover how to use session data and how to find out information about the current user (whether guest or logged in), restricting user access based on privilege and using a user's parameters.
"Multilingual Recipes": how to ensure your extensions can support other languages, and also how to provide a translation (if you're gifted that way!)
"Interaction and Styling": applying CSS, Javascript, Ajax and MooTools to enhance your extension. This does not cover what CSS is and how to style a page, but rather how to ensure you plug CSS into your pages correctly using Joomla!
"Customizing the Document": ways of modifying the response by working with the Joomla! JDocument object. The most interesting recipes cover how to create PDF and RSS or Atom feeds from your component. This chapter is a little hard to get into as so little context is provided, but it is assumed that the reader will already have that context from a fuller knowledge of how Joomla! extensions are designed and developed.
"Customizing the Backend": provides a useful set of recipes so you can customize the backend (or administration element) of your component. James covers useful items such as disabling the menu bar (needed if the user is currently editing the configuration, so they cannot for example logout when half-way through an operation), creating a filter header (like the article filtering by section/category in the in-built content component) and how to enable tabular data to be ordered (by licking on the table header).
"Keeping it Extensible and Modular": looks at how to use Component Based Development the make it easier to develop and ensure extensions are more flexible. One very useful recipe shows you how to write a search plugin for your component; a further set of recipes describe how to manage component parameters (enabling your users to configure the behavior of your component through the backend).
"JObjects and Arrays": "Error Handling and Reporting": "Files and Folders": The final three chapters cover some fundamental concepts and provide recipes that explain how to manipulate data, manage errors and deal with files and folders.
I personally have extensive experience of building web sites using Joomla! but have no experience in developing extensions. However as a software professional I have several years experience of software development, and will find this book very useful as I start to become more involved in developing extensions for Joomla!
You can purchase Joomla! 1.5 Development Cookbook from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
What this book does provide however is a number of "recipes" that developers can use to solve common problems when developing extensions for Joomla! As such it is a very useful resource that can be used in two ways: the inexperienced developer will want to read through the entire book chapter by chapter, to understand the issues they will need to consider. The more experienced developer will want to use this book as a reference book, dipping in when they encounter a particular problem or face a particular task.
The first thing to say is that (perhaps unusually for a software developer) James can write! His English is clear and I cannot imagine anyone having any complaints about his grammar. This means that despite being a technical reference the book is a pleasure to read.
Each recipe is laid out in the same format (as you would expect from any good cookbook!) The title of the recipe is followed by an explanation of the problem or task. "Getting ready" lays out what you must do before getting to the body of the recipe. "How to do it..." is laid out as a set of code statements with a brief explanation. "How it works..." provides more explanation on why to do what the recipe says, often accompanied by example data. "There's more..." lays out additional things to consider, perhaps more you can do with the recipe or alternative ways of achieving the same end. Where they are alternatives, James is generally very careful to explain the pros and cons of each approach. "See also" provides a cross-reference to related recipes in the book.
The first chapter is an essential introduction to getting involved in the Joomla! open source community through JoomlaCode.org. James explains how to create a new project and manage that project. The chapter concludes by explaining the use of TortoiseSVN for managing the source code of your project. I found that the explanation of the top-level folder structure and the use of branches within SVN was particularly illuminating.
The next two chapters provide further general background: chapter two provides recipes to ensure your extensions remain secure and chapter three describes how to work with the database. While James does not explain the underlying security issues (e.g. he does not describe what SQL injection is and why it may comprise security), the recipes provided (that address keeping your SQL safe, ensuring filenames and folders are safe and that you ensure that request data does not pose a threat) are easy to follow and I was able to work out why they should be used. The chapter on Working with the Database explains how to construct and execute SQL queries and the use of the Joomla!-specific JTable object. While I am familiar with working with SQL, this chapter was an eye-opener to me as it shows very clearly how working with the database under the Joomla! framework is different from conventional approaches, and how the JTable object makes it very easy to manipulate the database.
The remaining chapters of the book each focus in on a particular area. James covers the following topics: "The Session and the User", "Multilingual Recipes", "Interaction and Styling", "Customizing the Document", "Customizing the Backend", "Keeping it Extensible and Modular", "JObjects and Arrays", "Error Handling and Reporting", "Files and Folders".
The range of topics covered is such that it will ensure you at least think about some issues that otherwise may never have crossed your mind. For example, you may not have considered it necessary to make your extension available in other languages, but in the chapter on "Multilingual Recipes" James shows that it is incredibly easy to make your extension language-aware, so even if you're not going to provide a Slovakian or Sanskrit translation you can at least ensure that your extension will support those languages (should someone out there want to do the translation work for you — which is often what happens with Joomla! extensions).
A brief summary of the content of each chapter, with a few highlights picked out, follows:
"The Session and the User": recipes cover how to use session data and how to find out information about the current user (whether guest or logged in), restricting user access based on privilege and using a user's parameters.
"Multilingual Recipes": how to ensure your extensions can support other languages, and also how to provide a translation (if you're gifted that way!)
"Interaction and Styling": applying CSS, Javascript, Ajax and MooTools to enhance your extension. This does not cover what CSS is and how to style a page, but rather how to ensure you plug CSS into your pages correctly using Joomla!
"Customizing the Document": ways of modifying the response by working with the Joomla! JDocument object. The most interesting recipes cover how to create PDF and RSS or Atom feeds from your component. This chapter is a little hard to get into as so little context is provided, but it is assumed that the reader will already have that context from a fuller knowledge of how Joomla! extensions are designed and developed.
"Customizing the Backend": provides a useful set of recipes so you can customize the backend (or administration element) of your component. James covers useful items such as disabling the menu bar (needed if the user is currently editing the configuration, so they cannot for example logout when half-way through an operation), creating a filter header (like the article filtering by section/category in the in-built content component) and how to enable tabular data to be ordered (by licking on the table header).
"Keeping it Extensible and Modular": looks at how to use Component Based Development the make it easier to develop and ensure extensions are more flexible. One very useful recipe shows you how to write a search plugin for your component; a further set of recipes describe how to manage component parameters (enabling your users to configure the behavior of your component through the backend).
"JObjects and Arrays": "Error Handling and Reporting": "Files and Folders": The final three chapters cover some fundamental concepts and provide recipes that explain how to manipulate data, manage errors and deal with files and folders.
I personally have extensive experience of building web sites using Joomla! but have no experience in developing extensions. However as a software professional I have several years experience of software development, and will find this book very useful as I start to become more involved in developing extensions for Joomla!
You can purchase Joomla! 1.5 Development Cookbook from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
To Serve Butterfly.
The only upside of Joomla! is that at least it doesn't suck as much as Ruby on Rails does.
There are so many Rent-A-Coder jobs that want Joomla! extensions. And at $35.39 (free shipping!) at Amazon, you'll pay this off with just 4 or 5 RAC assignments! Then again, if you get a "duplicate [Jommla! website] maximum bid $100" you'll be able to pay it off with one job!
Yep! Do what you love and the money will follow!
PDF eBook? So, a book on open source is DRM laced? How ironic.
Don't lick on that table header! You don't know where that table header's been!
Fuck these goddamned Facebook and Twitter buttons. Adblock Plus FTW! Fuck Facebook because I'm not an attention-starved does-daddy-finally-love-me-now exhibitionist. Fuck Twitter because if I wanted to jump on the latest bandwagon and flock to the latest trendy site that does NOTHING novel, NOTHING that wasn't technologically feasible 10 years ago, just Instant Messenger with HTTP, I'd be there already and wouldn't need Slashdot to give me a fucking icon to get me there.
I was an early adopter of PHP back when it was becoming popular. It wasn't a great language, but it was well-supported by most hosting providers. And it was easier to work with than Perl CGI scripts in a lot of cases. After that, I did web development using Java for a while, then ASP.NET, and then Ruby on Rails.
I recently accepted a contract to do some Joomla! customization, and it was a terrible experience. The Joomla! codebase is absolutely horrid, but most of the plugins were even worse.
This client had some custom plugins written by some devs in India, and it was some of the worst code I had ever seen (and I've been doing web development for over 15 years now).
Thinking it was just a particular bad, but isolated, situation, I accepted another contract to do some non-Joomla! PHP work for a totally separate company in a different part of the US. It was the same thing. Their PHP code was godawful.
I think the problem is with PHP. It enables and encourages horrible programming, and I want nothing to do with it any longer. So I've started turning down work if it involves PHP. I'm fine working with Java, ASP, ASP.NET, Ruby on Rails, and Django. But I will never work with Joomla! again, and I will never work with PHP again.
v1.5 book released just in time for v1.6, wheeeee
Don't create new websites using Joomla.
Everytime a developper codes a joomla module, god drops a tcp packet.
Drupal is a far superior and really well thought-out PHP framework compared to Joomla.
I don't disagree that PHP makes it really easy to write horrible code, but that doesn't mean that all PHP is horrible, or that everything else is automatically better. For instance, I am currently working a large Java project that is far more of a horrible mess (and takes 10x longer to get actual work accomplished) than any PHP project I've ever worked.
"Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
JOOMLA FUCKING SUCKS!
You can't be serious, can you?
I might be missing something, but what does classic ASP provide that makes for better code structure than PHP?
I can understand the others, but not ASP...and if you still think that classic ASP makes for a better codebase, I invite you to come and marvel at the shambles that my current employer has as their main extranet system, written in classic ASP....
WebGUI is a much more powerful CMS than Joomla, and it's much easier to write plugins for.