Friday, February 18, 2011

Mobile Joomla and TERAWURFL database

 Mobile Joomla! is a great extension for making your Joomla site ready for mobile viewing but it adds in a 40M worth of tables into Joomla database. This potentially causes difficulty in database backup and recovery. So here are the steps to put all the terawurfl tables in a separate database. 

1) Go into phpmyadmin and copy you Joomla database as terawurfl.

2) Go into information_schema database and run the query

select concat("drop table ",table_name,";") from tables where substr(table_name,1,4) = 'jos_' and
substr(table_name,1,13) != 'Jos_terawurfl';

Note: I am assuming you are running Joomla database with prefix 'jos_', if not then change the above accordingly

3) Copy all the drop statements into clipboard.

4) Go into terawurl database and run SQL with statements copied from the clipboard. At this stage you have a database with just the terawurfl tables.

5) Now go back to information_schema database and run the query

select concat("drop table ",table_name,";") from tables where substr(table_name,1,13) = 'Jos_terawurfl';

6) Copy the drop statements to clipboard.

7) Now go to your Joomla database and run the SQL with statements copied from the clipboard. At this stage you have a database with just the joomla tables.

The above process would have taken out the terawurfl tables and put them in a separate database.

Now go and set database name, user and pass in plugins/mobile/terawurfl.php, They are currently picked up from the configuration.php You probably will just have to change the line to set schema to terarwurfl as the user and password would still be valid as we follow the above procedure.

TeraWurflConfig::DB_SCHEMA = "terawurfl";

Now you can backup your dynamically changing Joomla database more frequently without having the overhead of copying terawurfl tables as well. Also the database recovery time for Joomla tables will be lower too.

Thursday, February 17, 2011

Mobile Development and Joomla

Here is to get you going with getting your Joomla site ready for iPhone on your local PC. We start with the assumption that WAMP has already been installed, along with Joomla.

First download the Mobile Joomla extension from here. You have to register but it is free. The extension provides the support for carrying out mobile development.  It is a rather big component which adds a number of templates, plugins and module positions. So once you kick-off the install it could take 30-50s to install. Just disable the 'Mobile - Always' plugin as you don't want to your site to be permanently served via mobile. It may be alright in development environment to leave this plugin enabled but in production environment you have to disable it as you are serving different types of clients.

In mobile development you always have two choices. Either you can have a different URL in a subdomain for iPhone (multi-site option) or you can use the same URL and let the mobile plugin decide which template to serve (multi-client option). We will opt for the latter but if you want the multi-site option then you will have to set it up in the Joomla Mobile settings. We can adjust the modules for iPhone or just serve the default before tinkering.

Now establish the ip address of your local PC by running ipconfig. It will be something like 192.168.1.2.
.
Go to iphonetester.com. If you were typing localhost/joomla to get into your local website then you will have to type http://192.168.1.2/joomla in the tester URL. Now you have full simulation of your site as viewed by iPhone. You can start playing with module positions and experimenting. Enjoy!

Wednesday, February 16, 2011

Exciting meeting of London's Joomla User Group

I had the pleasure of attending my first-ever Joomla User Group meeting at University College London yesterday. The minor drizzle in the evening did not dampen the enthusiasm of the attendees who were all passionate about Joomla. It turned out to a lively session of two hours where a lot of insights were parted by the members.

We had a presentation on Joomla performance tuning which covered all the aspects from caching, compression, CSS and Javascript minification, MySql tuning and image servers. A suggestion that serving images from a different server speeds up the page download as the HTTP traffic becomes parallelized was particularly good. Also the warning that many image-bloated templates and sub-optimal extensions are the main culprit in reducing performance was welcome.

A lively discussion followed on extensions. The two most memorable ones for me were Alpha Content and Store Locator. The former provided a directory listing of articles in a category in an alphabetic manner and gave A-Z index on top to navigate easily to any content beginning with that letter. The latter gave a Google Map of Excel-loaded interest-points (they could be stores or individuals) to easily zoom in at their location or associated URL.

There were a host of other useful insights and this brief introduction does slight injustice to the meeting. I would suggest that if you are interested in Joomla then make your way to the next meeting on15th of March at 7.00pm.