Joomla! Q&A on Twitter - Part 1
We started a little experiment on Twitter to see what would happen when we gave anyone and everyone the opportunity to ask Rob Schley, JXtended Developer, Development Working Group Coordinator and Open Source Matters Board Member, any question they could imagine. Be sure to follow JXtended and RobSchley on Twitter to catch the next opportunity to get your questions answered by a Joomla expert. Without further ado, onto the questions!
AmyStephen asks: When will Joomla! 1.6 ship?
Rob Schley answers: The short answer is when it’s ready but I doubt that’s what you were looking for. The long answer is when the community decides they want it badly enough to step up and make it happen. There are a lot of things that need to be done to make 1.6 a reality and there are ways that every single person, regardless of skill, can contribute, if they want to. One of the things that always comes up at Joomla Days is how people can financially support the project. Donating money to the project is great but nobody gets paid by the project to work on the project. All of that money goes to community events, an occasional summit, project infrastructure, legal fees, taxes, etc. So, I often suggest that people talk to one of the current developers, team leaders, or coordinators and offer to help support their work on Joomla directly. Money is always tight but if 50 people each contribute 50 or 100 dollars, it makes a huge impact for people like us who eat, sleep, and breathe Joomla.
eeyorelibrarian asks: What's your best advice for migrating to Joomla 1.5?
Rob Schley answers: I always start with the template. Once I have the template, I will install the 1.0 migrator, export the data, setup a new Joomla 1.5 site using the import data option and give it the SQL file that the migrator created. Then, I go through and fix the menus. After that is done, the site should be somewhat usable. From there, I start reassigning modules and fixing the issues that will inevitably come up with the template. I haven’t migrated too many sites that use a lot of 3PD extensions so if you have a lot of extensions, it is going to be a bit more complicated. Mentally, I approach it as I am building a new site that happens to have the same content and the same look as the old site. It takes 8-12 hours of work for me to migrate a site depending on how much massaging needs to be done.
newlocalmedia asks: What do you see as the biggest lessons you've learned from working on Joomla?
Rob Schley answers: I would say there are two lessons that stick with me more than any others. The first is that I should always speak my mind openly and honestly. I learned that I always ended up more miserable when I held my tongue so I had to break myself of that habit. As a side affect, I learned that my worries about how people will respond to my objections were almost always unnecessary and far from how they actually did respond. The second lesson I learned is how complicated building software for general consumption can be when you don’t have complete control of the stack. When you are building software for your server, everything is easy because you know what the environment will be, you know what the settings will be, and if necessary, you can change them. Building software that is widely used in shared hosting environments is extremely complicated. There are millions of possible configurations when you consider software versions and the hundreds of options that packages like Apache and PHP have. In an environment like that, you will experience problems that you never thought were possible.
zuno asks: What is the best way to minify all JavaScript dynamically loaded to a page to cut down on script tags?
Rob Schley answers: I would do this with a plugin. In fact, I have done this with a plugin. There are too approaches that you can use depending on how zealous you want to be. One approach is to grab the head data in JDocument, extract it, minimize it and reset it before the template is parsed. That will allow you to minify all JavaScript that is added before the template is parsed (which, in reality, isn’t very much). The more zealous approach is to catch the document buffer after it has been rendered and process it with regular expressions to extract the JavaScript, minimize it and reset it back in the buffer. This is the more zealous approach but it is harder and, some would say, not very clean. In Joomla 1.6, you will have the best of both worlds as we added a new plugin hook that allows you to get into the document object after the template has been parsed but before it has all been rendered. This will make this whole task much easier because you can use the first approach but achieve the results in the second approach.
To grab the JavaScript from the head you would do something like:
// Get the document head data. $doc = &JFactory::getDocument(); $data = &$doc->getHeadData(); // Linked JavaScript is in $data['scripts']. // Inline JavaScript is in $data[‘script’]. $data[‘scripts’] = // Compressed linked JavaScript. $data[‘script’] = // Compressed inline JavaScript. // Push in the updated head data. $doc->setHeadData($data);
Greg_SmartSwipe asks: Here is a variation of the desert island question - if you could only install three extensions, which three would you pick? Just to make it a little bit easier, our fictional three-extension-only site is a general purpose internet site...
Rob Schley answers: Well, not to blow my own horn but I would take Labels and Finder and a high-quality, well-designed, site-appropriate template. In my opinion, Finder and Labels solve problems that every site needs to address. We invested years of R&D into those extensions so that they solved a problem that almost every Joomla site has to deal with at some point or another: findability. Lastly, the template will make or break a site. It could be the coolest looking thing in the world but if it doesn’t work with the site or confuses the user, you might as well just pull the plug and go home because your users will.
matthewva asks: What is the best architecture to run joomla on different servers (different geographic locations) but use same content (database)?
Rob Schley answers: I would probably do this with MySQL replication but it would depend on a lot of specifics to say exactly how it would be implemented. MySQL lets you replicate data from one database server to another in (fairly) real time. High-traffic web sites often use this to replicate data across multiple database servers to reduce the load on each individual server. There are a lot of technical issues that come with this system but it is pretty reliable once it is setup correctly and monitored. You can also configure replication to replicate only specific tables within a database which may be perfect for your situation. I am not sure if you want the site to be the same for all locations or if you would like to just share one content repository but if you only wanted to share the content repository, you could just setup MySQL to replicate the content table and leave all the other tables alone. That way, each site would have it's own look and feel, navigation, users, sessions, etc. If you want them to look exactly the same, you could replicate the entire database. The biggest obstacle in dealing with this scheme is with database writes. Traditionally, MySQL replication means there is one master server and one or more slave servers. All writes are supposed to go to the master server and then propagate to the slave servers. There is such a thing as multi-master replication but it can be pretty precarious, especially if you have servers in different physical locations.
digitallofi asks: What is the easiest method for building custom fields & forms, 1.5 native?
Rob Schley answers: Custom fields can mean different things so I will answer it the best I can. If you want to attach extra properties to your existing content you might want to look at something like Custom Properties. If you need something more advanced, a CCK tool like K2 or Zoo might be what you’re looking for. Custom forms are pretty common and there are many extensions out there to solve that problem. Take a look at the Forms category of the JED. I don’t have any particular recommendation because I’ve never really used those extensions. Being a developer, I find that it is generally easiest for me to just code something for the specific problem that I am trying to solve.
digitallofi asks: What are some intermediate & advanced uses of the Page Class Suffix? Or rather, how to use the Page Class Suffix to change .css styles.
Rob Schley answers: This is an interesting question and a good opportunity for me to share an idea I came out with a while back when looking at Wordpress themes. Wordpress defines a page type for you and then the theme will generally ask the application which type of page it is on with methods like is_home(), is_page(), is_search(), etc. I had the idea to use the page class suffix field in the menu manager to achieve a similar effect. For example, you set the default menu item’s page class suffix to “home”, then the search page gets “search”, etc. Then, you can use some simple PHP logic to control all sorts of interesting things based on the page class suffix. Note, I have not tested this code, it is just off the top of my head but it should get you started:
$app = &JFactory::getApplication();
$menu = &$app->getMenu();
$active = &$menu->getActive();
$params = &$menu->getParams($active->id);
switch($params->get(‘pageclass_sfx’))
{
default:
case ‘home’:
// Do some stuff for the home page.
break;
case ‘search’:
// Do some stuff for the search page.
break;
// etc...
}
mark_up asks: Why are there (hundreds of thousands of?) websites out there with 70KB of JavaScript just to show captions.. which are rarely even used?
Rob Schley answers: Because the community didn’t object loudly enough to make us reconsider that decision. We do the best we can. We don’t always make the best decisions but we usually try to make the right one. Sometimes people come along and ask if we considered X or Z or whatever and sometimes the answer is no but unless that dialog happens, the community might get stuck with whatever crazy idea we came up with at 4:00 AM after drinking 9 cans of Redbull and not sleeping for 2 days. This is why community involvement is important.
zuno asks: What is the easiest way to update a minor version of Joomla? i.e. 1.5.9 to 1.5.10
Rob Schley answers: I am a geek so I insist on doing things efficiently. The fastest way to update a Joomla site from one minor version to another is with SSH access. Basically, all you have to do is get into the main directory of the Joomla site (where the configuration.php file is), use `wget` to download the Joomla package you want to use (or just upload it with FTP), then extract the package. Let's say your site is running Joomla! 1.5.9 and you want to upgrade to 1.5.10.
rob@jane$ wget "http://joomlacode.org/gf/download/frsrelease/9911/37957/ Joomla_1.5.9_to_1.5.10-Stable-Patch_Package.zip" ... rob@jane$ unzip Joomla_1.5.9_to_1.5.10-Stable-Patch_Package.zip Archive: Joomla_1.5.9_to_1.5.10-Stable-Patch_Package.zip replace administrator/language/en-GB/en-GB.com_content.ini? [y]es, [n]o, [A]ll, [N]one, [r]ename:
When it asks you if you want to replace the file, enter "A" for all and it will replace all the files that have been updated. Clear your cache and you're done.
Comments
Add Comment