Wednesday, July 29, 2009

Build your own Joomla template - creating a blank template

So here we go.

The layout I want to achieve is the one on the previous post and having made the decision to start from scratch I have poked about inside the 3 templates provided with Joomla looking for a common approach and so I can also steal tips from them as and when I need them.

Setting up a new template to work on

There is a very good tutorial on the new wiki http://docs.joomla.org/Tutorial:Creating_a_basic_Joomla!_template. The trouble with this method, although excellent, is I to get everything ready before messing with templates, sometimes it can be quite useful starting with a core template and stripping it down, learning as you go.

Copying templates to play with

Being an impatient fool I wanted faster results so I thought it would be a wicked wheeze to copy an existing template and then customise it. I think this is worthwhile so you can experiment with them without damaging the originals. Little did I know that this path would take longer.

The template I picked was rhuk_milkyway as it looked a lot simpler than beez or ja_purity. I took a copy of the files into another directory and renamed the template, by editing the templateDetails.xml file, zipped the files and ran the install. Big Mistake!

I then spent ages dealing with all the install error messages (File '/Users/xxxxx/Sites/yyyyy/zzzzz/tmp/install_4a82e20665eca/images/mw_box_blue_bl.png' does not exist.) as surprise, surprise not all the files in the templateDetails.xml seemed to be there which was bizarre. So I ended up editing templateDetails.xml and commenting out all the missing files, which took some time. I have found this doc http://docs.joomla.org/Tutorial:Create_a_copy_of_the_MilkyWay_Template But to be honest this indicates that perhaps this template is not a good place to start. If there are harcoded links to files in other files then I suspect that it is probably better to start again.

I have since done the same with JA_purity and Beez and this works pretty well. Strangely I still get warnings about files in the language section of the templateDetails.xml, but these files already exist in the Joomla build so I am not going to worry for now.

At least now I have some test versions of Beez and Ja_purity which I can play with without causing damage.

Generating the template install file


In the Joomla 1.0.x days there was a nice little script from http://www.joomlart.com which would generate the templateDetails.xml file so it was easy to package up your template once it was finished. Searching http://extensions.joomla.org for an updated version can can see lots of nice new standalone tools for modules and templates but sadly they all are for Windows and I can't seem to find one for non windows environments. This means that I will probably have to code templateDetails.xml from scratch which will not be fun but I think I will face that challenge when I get to it.

Wednesday, July 22, 2009

Joomla Templates - build or buy (or use a free one)?

There are a gazillion Joomla templates out there and they are all pretty excellent, even the templates you buy are usually of very high standard.

The question is whether to use one of these or build your own.

From my own subjective view these templates are very sophisticated but they are often "very Joomla" in their layout. There is no question that if you find one that suits your needs then even if it is not free it is fantastic value for money. It may also be that if the Joomla user has no real design skills then you can achieve a phenomenal look and feel for the website with no effort. The issue of whether to build your own or use a pre-made one is therefore always around the specifics of your requirement and if you haven't got the skills finding someone to do it for you. For me there are two key issues.

Module Positions

The real issue I personally have with pre-made templates is the rather limited functionality the template builder has to work with, this is not the template builders' fault or in fact Joomla's but the simple fact that the temlpate has to be built using a known set of positions that can be depended on in a standard Joomla installation.

To explain this further the standard templates that come with a Joomla implementation have the common positions of breadcrumb, left, right, top, user1, user2, user3, user4, footer, debug, syndicate. When you load Joomla initially the modules that are enabled are placed in those positions so everything works straight away. I could be wrong (my memory of 1.0 is a bit hazy now) but it is a great improvement in 1.5 that the positions are now set in the template rather than in the Joomla admin interface, but the template builder is still limited to use those positions in order for a template to be successfuly applied to a default Joomla install. You therefore end up with a Joomla install which only really uses these positions (and perhaps a few more).

In my case I have a very different need for a home page so I am not sure these default positions will work for me.

Front page layout

The front page component is excellent for featuring content on the front page, but I find it a bit limiting in layout. You tend to end up with a single list of articles which can have some versatility in having 2 columns or perhaps some items across 1 column then the rest in two columns (or more), but that is kind of "it".

For my own needs I want areas populated with story teasers all over the place, so the traditional front page is not for me. 4 years ago a looked for a solution for this and there were lots of front page type components, but they didn't really do the job so I gave up. This time round I experimented first of all with the Latest News module which can be focussed on different sections (i.e. I could have a few of them with different content in them) but they only list the title which was not for me.

My next experiment was my old friend the contentitem module which has now been renamed to mod_placehere. This module is build by Eike Pierstorff and you can find his blog here http://www.diebesteallerzeiten.de. This is such a superb module. It was useful 4 years ago for featuring a item in a position or perhaps a list of items in a position, but it has come on leaps and bounds. Eike seems very receptive for ideas and input and pretty responsive. This has to be my number 1 fave module.

Now I have what I need for my front page, I can essentially place loads of mod_placehere components anywhere I need on the front page to achieve what I need.

So the jury is out for me, I am going to build my own template, I will have to learn a bit from the other templates but I am pretty confident that I can achieve what I need in look and feel by going my own way. Don't let me stop you using a pre-made template they are really excellent.

Wednesday, July 15, 2009

Getting rid of tables in Joomla - Template overrides

Tables in Joomla pages have always annoyed me. I am not a fan of tables now that I have learnt that web standards, table-less layout is the way forward.

I was therefore a bit miffed that I saw tables in my markup once I had installed Joomla. I did some digging around and also saw that the choice of template affected this which was encouraging.

A quick bit of searching around in the new docs wiki http://docs.joomla.org and I found several cool things


I know all Joomla 1.5 experts will know this stuff (this is a blog of a journey through learning Joomla after all.), but for me as a 1.5 newbie this is fantastic. No tables and total layout control - wicked.

I still think the Joomla crowd should make sure that the default templates delivered in the build are tableless, it would start users off on the right foot. I appreciate that there has to be backward compatibility but at least make sure the 3 delivered templates demonstrate best practise.

I'll document thoughts on this as I get results.

Thursday, July 9, 2009

Why Joomla ? Why not Drupal ?

There are plenty of passionate posts all over the internet stressing why Joomla and Drupal will save the earth, so I am not going to bore you with that kind of stuff. The interesting thing for me is that technologies change over time so the reason for using one versus another will change over time too.

What I have found over the last 25 years or so is that techies can be extraordinarily protective of the technologies they have chosen, sometimes to the point of technical bigotry or even semi religious fanatism. You therefore get some amusing comments at the bottom of blogs that debate which one to go for.

My own views on different tech' have fluctuated over time. for example I first thought Microsoft could do no wrong, then they were evil incarnate and now I have a deep respect for them (but choose not to use too much of their stuff). Interestingly these different viewpoints were based on my knowledge at the time i.e. at first I didn't know better; then I competed with them with ColdFusion and now I use a Mac and love opensource. The bottom line is that with tech' one needs to pick the right horse for the right course and in every case the course will be different.

Horses for courses is definitely the right approach when comparing Drupal and Joomla. I have built sites with both and think that both are excellent. For my own current project I would love to do it in Drupal for the coding fun, but I just don't have the time.

When I thought of reading up on the debate on Durpal Vs. Joomla I got lazy and googled Drupal vs Joomla then picked the first entry. The post is froma Drupal fan and they do try and be slightly balanced, but you can still detect the bias creeping through. It's as if the author is giving us Joomla users a little pat on the head in a kind of "there, there if you must play with a CMS why don't you go and play with Joomla while us adults get on with the real work" style.

I have critiqued the entry for fun and confess up front that my Drupal experience is only from V5 so I am very guilty of not being up to date on Drupal - apologies if I get stuff wrong. The author from mydrupal.com cites the following (bear in mind this post was from 2007 so there will be some inaccuracies):-

Drupal
  • Rock solid & high quality platform - who says that Joomla isn't? This is a null point
  • Real multi-site-feature (only one installation for several sites) - True, if you need multi sites integrated then this is good
  • Any Kind of user groups & user permissions, OpenId compliant in Version 6 - True (ish). The statement is true but whether it is important for you or not depends how horribly granular you want your user roles. There seem to be some more add-ons for Joomla to solve this, but I haven't researched them yet.
  • Can run membership and community sites, not only CMS etc - The implication that Joomla can't is totally untrue
  • Powerful templating system. Any XHTML or CSS template can be easily converted to Drupal. - I'm not convinced of the ease from my own experience Joomla Templating is a dream. Essentially both are good, and there are many more third party templates out there for Joomla.
  • Drupal needs a little time investment to realize all the huge possibilities of Drupal - Understatement. Getting under the hood with Drupal take a bit of work. if you are not good PHP developer this can be hard.
  • Clear, high quality code and API (easy to integrate with other solutions etc) - True, but not untrue for Joomla
  • Flexibility and no known limitations- Probably more flexible than Joomla but it depends on whether you ever need the extra flexibilityor whether you have the time to develop code to leverage that flexibility.
  • Many high profile sites use Drupal (e.g.: MTV UK, BBC, the Onion, Nasa, Greenpeace UK, New york observer. ) - True, but there are high profile sites using Joomla check out this one from Scripps http://www.food2.com.
Joomla
  • If you are not techy its good to start - True, but if you are a techie you can achieve some magical things just as you can in Drupal
  • Easy install & setup with your mouse -They are both easy to install, Joomla's install is particularly good.
  • Easy learning curve - True, Drupal's learning curve is not so easy
  • Cannot integrate other scripts etc. to your site - Complete codswallop.
  • Generally you cannot create high-end sites, without investing huge amount - This is misleading, you can create high end sites and depending on the function you might even expend less effort. This really depends on your definition of "high end"
  • No SEO out of the box, URLs are not search engine friendly. - Pretty rubbish statement, Joomla sites do well with SEO.
  • Server resources utilization is more compared to drupal - I wouldn't know, but is there a real impact on this one ? Big sites like Joomla.org seem to work OK.
  • Only one site per installation - True
  • No Single Log-in to several sites - True not without some coding
  • No User groups & permissions - Not strictly true it would be more true to say no "customisable" user groups and permissions. Durpal's user groups and permissions functionality is very granular
  • More intuitive administration user interface - True, although I heard on a podcast that an agency has been doing alot of work on that for Drupal recently
  • Some polished modules for things like calendars, polls, etc. - Some ?!!! - Thousands! and from my experience quality is is often much higher
  • Modules cost you money - Untrue, some do.
You can see that the above is influenced by the writer's own experience and drops lots of annoying hints that Joomla is not a scalable or quality platform which is complete balderdash. I hate the way some web developers intimate that if it's not hard then it's no good as the points above raise.

The truth is both platforms are excellent and the reality is that choosing either depends on your own requirements and resources. So I would personally simplify the argument as follows:-

  • If you want multi-site (single login) go Drupal
  • If you want very granualar roles and security beyond the layers that Joomla or an add on provide go Drupal.
  • If you are a developer and love getting under the covers and changing everything, have loads of time, then you will enjoy Drupal more, but Joomla 1.5 has a load of stuff to keep you entertained.
  • If, however, you are in a hurry or don't want to code your way around everything then Joomla will get you there quicker and easier
  • If you have little or no technical skills then you won't get far with Drupal but with Joomla you can add a template and start adding you content. If, however you are completely untechnical then you might want to get someone else to do it for you.
  • If you want one article to appear in more than one place in the site (and you need to do this a lot i.e. so posting a duplicate won't do) then go Drupal.

Some other points


Yes Drupal has workflow of a sorts, but in V5 it took me while to get it to work well - are you that large and distributed as an organisation as to need workflow ?

Joomla has a fixed content hierarchy of Sections which contain categories, for some very content heavy sites this may be a limitation. Drupal on the other hand has no such structure which provides limitless possibilities. The taxonomy based approach you could use for site structure is very cool if you need it.

I haven't looked at Drupal V6, but I would seriously look at the editing and image handling features of both before you make decision. JCE on Joomla is superb and I couldn't find very good image modules for Joomla which made editing articles quite tricky for the unitiated.

Virtumart for Joomla is excellent if you want a good almost out of the box ecommerce store as part of your site.

Finishing off

For me, for this project specifically, I am using Joomla. I don't have a lot of time and the requirements don't dictate Drupal. My advice would be if you need Drupal's unique features you have no choice - otherwise Joomla will do a damn good job.

Wednesday, July 1, 2009

Why this blog ?

About three/four years ago I built my first Joomla site http://www.wildlifeaid.org.uk as a volunteer effort. It took about 2 weeks and the results were pretty good considering. Wildlife Aid, went from a static site to a site they could update themselves and thsi had a positive impact on site traffic.

I built my own template choosing a fairly simple free one and modified it. I confess the template was pretty crap, I used tables for layout and my CSS skills were pretty poor, but it worked.

The site is now showing it's age so it's time to build a new one and this time, I thought it might be useful to record things I learn along the way so other people might benefit.