That illustration encapsulates this post nicely, so stop there if you’ve got the gist.
I went with Joomla for a project on a few of its strengths: Fine-grained content control, a very active developer community that cranks out lots of decent third-party extensions, and a fairly sophisticated community of template developers who make some decent designs.
It’s not without its flaws. I used to complain bitterly about StoryServer from the user interface side, but Joomla has a few baroque conventions of its own. They seem to be there because some developers, instead of making a good interface, made an interface they thought would be good for users who were exactly like themselves, only total cretins.
Anyhow, I looked around the backend, did a few tests with it, decided I could impose it on someone else in good conscience, and grabbed a template for the project.
The commercial Joomla template authors are generally down with the whole CSS-driven layout thing, so it’s easy to find something usable with reasonable modification terms that’s forward-thinking. If you paw through the template code, you won’t see anything objectionable. I went that direction because I didn’t want to deal with learning Joomla’s templating system right away. So I found a good template with the right general layout and look for the project and set to work on refining the style sheets. That’s when I learned Joomla’s unhappy secret:
Underneath all the templates and stylesheets, there’s one file driving the pages, and it’s a giant mish-mash of tables. Further, most of the modules you encounter tend to produce tables as their output. You can refine the output on modules to strip out the table code and just wrap stuff in divs, but for the main content loop you get tables, and there’s no way around that in the software.
It gets kind of ridiculous, too. The core logic has every single element on a page getting tucked into its own row or cell. When that’s stuck on top of the templating code itself, it’s a cluttered, opaque read. And the HTML it outputs is ungainly and sloppy. The tables severely limit your ability to control vertical space, you have to hack the core files to do some perfectly sensible things (like put your byline, dateline and section on the same line instead of spreading them over three), and little of the output below the table level is assigned a class.
People have hacked up the core Joomla files to get rid of the tabular layout, but the hacks are imperfect because they don’t take into account the column options Joomla provides. So if you want multi-column layout, you’re either going to be hacking someone else’s hack or live with tables until Joomla 1.5 comes out, which is supposed to address a lot of this.
There’s also an after-market in modules and add-ons designed to get around the woefully inflexible layout. Some of them are good (and cost plenty), some of them are awful and demonstrate that it’s possible to spend your days digging a tunnel from a dungeon and into a sewer.
I’m living with it for now, myself. It makes a lot more sense to insert a few easily documented classes into the rat’s nest of tables Joomla spits out so I can get slightly better control of the presentation and sweat/change less when patches come out.
It’s a good object lesson, though, in why tables suck for layout. Any residual “I’m gonna smash the evil tables coz ALA told me to” lemmingism has been burned away in the purifying fire of realizing that tables are just a pain in the ass to deal with. Any fragility one might claim about CSS-driven layout is offset by how hard it is to get good control over table-based design — especially if it was written by someone else and without an eye to making the design part of the job easier.
In the interests of helping anyone who comes through here at some point in the future, here are some things I learned that may work for someone else coming to grips with Joomla’s unfortunate guts:
Later versions have introduced a workaround to the core /components/com_content/content.html.php file. Just make a directory called “components” under the top of your template directory and copy the file into that. It replaces the original file from the Joomla core on page render. You can hack it up with impunity and not worry about misplacing the path back to factory defaults. I’d like it if the template designers crowing about their “100 percent CSS layout!!11!!!” would take advantage of that and deliver on their claim 100%.
This doesn’t help the main loop, but you can get modules to render without table code using switches in the templates:
-1 will remove all the surrounding code
-2 will wrap the output in .moduletable and put the title in an h3 tag
-3 will wrap the output in three layers of divs and put the title in an h3 tag
Here’s an example of a tableless joomla hack. (And note that registration is required to get at the files everyone says they’re posting.) If you want to hack that hack to get something like a leading article back into the design, look at the file content.php around line 1247. I never got my use of that hack past the “looks o.k. on my Mac browsers” stage, and never worked on styling the output.