Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Joomla! 1.5 Development Cookbook

samzenpus posted more than 4 years ago | from the read-all-about-it dept.

PHP 32

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.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.

cancel ×

32 comments

Sorry! There are no comments related to the filter you selected.

Alternative Book Title (0)

Anonymous Coward | more than 4 years ago | (#30952924)

To Serve Butterfly.

Feature Creep (0)

Anonymous Coward | more than 4 years ago | (#30953300)

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.

At least it's not as shitty as Rails (0, Flamebait)

Anonymous Coward | more than 4 years ago | (#30952952)

The only upside of Joomla! is that at least it doesn't suck as much as Ruby on Rails does.

Re:At least it's not as shitty as Rails (1)

Narcocide (102829) | more than 4 years ago | (#30957084)

Liar it sucks twice as much and you know it.

Great for RAC jobs! Lots of Joomla! work! (0, Redundant)

Anonymous Coward | more than 4 years ago | (#30952966)

There are so many Rent-A-Coder jobs that want Joomla! extensions. And at $35.39 (free shipping!) [amazon.com] 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!

Hmmm (0, Troll)

Antony-Kyre (807195) | more than 4 years ago | (#30953042)

PDF eBook? So, a book on open source is DRM laced? How ironic.

Re:Hmmm (2, Insightful)

sakdoctor (1087155) | more than 4 years ago | (#30953150)

That's not ironic, that's just incongruous.

Re:Hmmm (1)

cormander (1273812) | more than 4 years ago | (#30953164)

Irony yes, but the book itself isn't licensed open source. Unless of course it was published under the FDL, which I don't think any book publisher would do.

Re:Hmmm (0)

Anonymous Coward | more than 4 years ago | (#30955026)

What's ironic about it? There are plenty of books about open source technologies that aren't open source themselves. Most authors actually want to be paid for their work.

by licking on the table header? (2, Funny)

gcalvin (325380) | more than 4 years ago | (#30953132)

Don't lick on that table header! You don't know where that table header's been!

Ugh, Joomla!. It drove me back to Java and Ruby. (0)

Anonymous Coward | more than 4 years ago | (#30953466)

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.

Try Drupal (3, Insightful)

Wraithlyn (133796) | more than 4 years ago | (#30954974)

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.

Re:Try Drupal (1)

DesertBlade (741219) | more than 4 years ago | (#30955302)

I agree Drupal is better, but it takes a CS degree to use it. I was able to get my company to adopt a Joomla website over Drupal, and once set up they don't have to contract out to some 'web guy' to update content.

Re:Try Drupal (1)

xTantrum (919048) | more than 4 years ago | (#30955906)

ha ha, so you recommended yourself out of a job?

Re:Try Drupal (0)

Anonymous Coward | more than 4 years ago | (#30956338)

Who said he's a programmer? I'm an accountant, but I can setup a Linux server and install Apache, PHP and Joomla or Drupal on it.

By "contract out to some 'web guy'", he was probably referring to them not having to pay some Indian guy to fuck up a whole lot, and then produce a mostly-broken custom PHP site.

Re:Try Drupal (1)

0100010001010011 (652467) | more than 4 years ago | (#30959506)

I've been comparing both to replace 2 of my websites. While it may require some knowledge to use, for the most part it 'just works'. The hooks are simple.

And in what stunned me the most, I would download a random theme. Run it through the W3 validator... and it came back valid. With what ever document I threw at it.

Joomla was much more difficult to try and get what I wanted. And there seemed to be more "Pay us and we'll fix it" installations.

Re:Try Drupal (1)

Wraithlyn (133796) | more than 4 years ago | (#31041222)

I have set up plenty of Drupal sites for non-technical users who have no problems updating content. It's important to create Roles carefully tailored for specific use, instead of just handing them the Admin account (which would be quite bewildering).

I will certainly admit that building your first Drupal site comes with a near vertical learning curve, but the community is fantastic at providing help, and once you get over the hump it's an incredibly powerful, flexible, and extensible platform, with thousands of modules covering just about any feature set you can dream of.

Re:Ugh, Joomla!. It drove me back to Java and Ruby (0)

Anonymous Coward | more than 4 years ago | (#30957766)

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....

update soon? (1, Insightful)

Anonymous Coward | more than 4 years ago | (#30953726)

v1.5 book released just in time for v1.6, wheeeee

Re:update soon? (2, Insightful)

creimer (824291) | more than 4 years ago | (#30953840)

Considering how long Joomla! 1.5 has been out before this book appeared, don't expect a mad rush of books for Joomla! 1.6 when it does come out. Being a Joomla! module developer myself [cdreimer-associates.com] , I'm hoping that the transition between the two versions will be relatively painless.

Re:update soon? (2, Funny)

SuperCharlie (1068072) | more than 4 years ago | (#30954318)

If Ive learned anything from the 20-30 sites Ive done with Joomla, its that nothing with Joomla is painless.

Re:update soon? (1)

creimer (824291) | more than 4 years ago | (#30955774)

True. Since my modules don't get into the guts of Joomla, I'm hoping that it will only be a version number change in an XML file. The next project I'm working on probably won't be that painless.

Re:update soon? (1)

RyuuzakiTetsuya (195424) | more than 4 years ago | (#30957806)

rm -rf /var/www/

That's pretty painless when dealing with a Joomla! install.

That being said though, I work with Joomla! as an internal tool. It's not as painful as any number of CMS systems I've worked with, but it's certainly not the best. the API in 1.5 is surprisingly robust but has some documentation issues. Thankfully if you can fully grok PHP, and don't mind peering into the codebase every now and then, it's not a horrible experience.

Re:update soon? (1)

mfh (56) | more than 4 years ago | (#30953876)

Joomla is good for some things, but for most things Wordpress or even Google pages is better.

Re:update soon? (2, Insightful)

roadsider (970039) | more than 4 years ago | (#30955236)

We've deployed sites using both Wordpress and Joomla, with all of the Joomla sites going out after I came on board. Since that point, I've also had to deal with all the Wordpress sites done by my predecessors, and there's nothing about those that I consider "better" than the ones we've done with Joomla. In fact, on at least one site, we really need to hire a developer to properly incorporate a feature we could easily do by installing a free Joomla extension.

Joomla is not a great system if all you want is a blog, but if you really want to manage content, Wordpress has come up short big time in my mind.

Re:update soon? (0)

Anonymous Coward | more than 4 years ago | (#30960520)

In fact, on at least one site, we really need to hire a developer to properly incorporate a feature we could easily do by installing a free Joomla extension.

Considering you properly vetted that "free" Joomla extension....

For the sanity of all involved. (2, Informative)

Thetawaves (1113619) | more than 4 years ago | (#30953768)

Don't create new websites using Joomla.

Joomla! is evil. (3, Funny)

Rhaban (987410) | more than 4 years ago | (#30953790)

Everytime a developper codes a joomla module, god drops a tcp packet.

Re:Joomla! is evil. (1)

moore.dustin (942289) | more than 4 years ago | (#30953956)

I laughed.

Re:Joomla! is evil. (1)

creimer (824291) | more than 4 years ago | (#30954244)

That explains my network performance. Now I can blame Steve Jobs for this. :P

it is evil (1, Funny)

Anonymous Coward | more than 4 years ago | (#30955586)

JOOMLA FUCKING SUCKS!

Try WebGUI (1)

PlainBlack (594355) | more than 4 years ago | (#30957958)

WebGUI [webgui.org] is a much more powerful CMS than Joomla, and it's much easier to write plugins for.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>