Posts Tagged ‘joomla’
New Lynda.com Joomla! videos
Last Friday, Lynda.com released another volume of Joomla! videos created by Jen Kramer McKibben. Now, in addition to watching videos about all of the major content management systems, you can also learn how to create Joomla! templates and CSS with Jen. Head on over to Lynda.com now and preview some of the free videos.
Quick and dirty christmas list – a Joomla! Recipe
Right around Thanksgiving, my mother will usually email asking for a list of Christmas gifts. This previously presented a messy problem: we would have to sit down, come up with a list, send it to Mom, then she would have to circulate the list and coordinate who was buying what. Instead of doing that this year, I told Mom to wait a week. Ten days later, I managed to scrounge up enough time to dash off a Joomla!-based system to handle all of this. Joomla! took care of the basic interface and user management tasks, leaving me to finish off the rest as an MVC component.
First, I installed a standard copy of Joomla! 1.5 with no sample content. I adjusted the parameters of the default rhuk_milkyway template so that it would have green links and headers (Color Variation) with a solid red background (Background Variation). I could have ditched the Joomla! logo in the header, but was lazy and just left it in.
Next, I added an instance of the Login module and unpublished the main menu. Although the main menu was unpublished, I left it in the system as a holding place for the default menu item. I also set Joomla! to disallow account self-registration: only seven specific people would ever be logging into this site and I didn’t want any passers-by creating accounts. I created an additional menu and set the access level to registered users only; no need to show the world any piece of our application. This menu included a link to the User Form Layout which I titled “Change my password” (even though you can do more than change your password from this form).
Finally, I cobbled together a custom MVC component to handle the lists. Before writing a lot of code, I created a menu link pointing to the component on the main menu, then adjusted the login module to redirect to this menu item after authenticating. This makes the login process seamless: you don’t see any parts of or links to the list component before you are logged in. Your only options are to either log in, retrieve your username, or retrieve your password. Once you’ve successfully logged in, you’re immediately taken to the component.
After configuring the login module, I continued to build the component. Before calling the controller, I used this code to make sure the user is logged in before continuing:
if (!$user->id) {
global $mainframe;
$mainframe->redirect('index.php',
'No peeking! You have to log in first.');
}
Next, I have controller sets the default view to ‘mylist’. This view lists all of your requested items and provides a form for entering more. To set the default view, I overrode the display() function for the controller like this:
function display()
{
$view = JRequest::getVar('view', '');
if ($view == '') {
JRequest::setVar('view', 'mylist');
}
parent::display();
}
This way, if ‘task’ in the request is empty, the component automatically calls display(), finds that ‘view’ is also empty, then sets it to ‘mylist’. Now, while the ‘mylist’ view lists all of our requests, it does not display the purchase status of those gifts. In addition to the ‘mylist’ view, there is an ‘item’ view providing a form where you can edit gifts you’ve already added. Links to the ‘item’ view are provided from the ‘mylist’ view.
In contrast to ‘mylist’, the ‘otherlists’ view displays all of the gift requests from all the other users, while listing gift purchases. It also has links you can click to mark yourself as having bought a specific gift. This way, people know not to buy something you’ve already purchasing. The code also makes it possible to mark multiple people as chipping in on a gift.
While the ‘item’ view simply loads a single row from the database, the ‘mylist’ and ‘otherlist’ views have their own data models. The data model for ‘mylist’ is very simple and has only one function, but the ‘otherlists’ model has functions for getting a list of all users, getting the buyers for each item, and getting all of the items listed by everyone else.
While there is more code I would like to add (such as gift suggestions for people who are slow about building their wishlist), following the MVC pattern now will make it easy to do that later. In the meantime, here’s a link to the code as it stands today (NOTE: this is not an installable Joomla! package. Drop com_christmaslist into the frontend components folder, run the .sql, then make an entry into jos_components if you want).
Textmate Bundle for Joomla!
I’ve been an avid Textmate user for a while now. It’s a text editor for Mac OS X that allows you to automate a lot of common text tasks. The editor has the concept of bundles, where you can group similar code snippets and macros together; selectively using each depending on the type of file you’re editing. Textmate also allows you to edit the core bundles that ship, as well as create custom bundles for your own projects.
To help with my Joomla! programming, I’ve developed a bundle of snippets for commonly used code. You can download it here. Unzip the package, then double click on the bundle to install it in Textmate. I’ve been slowly collecting snippets for a while now, so there’s some Joomla! 1.0 snippets as well as Joomla! 1.5, but it’s mostly 1.5 now. I’ll probably clean this up someday and add more functionality, but for now, here it is. No warranties, all the usual legal stuff, etc… enjoy!
Keep up with official Joomla! security updates
While helping people get the Podcast Suite up and running, I’m noticing that a lot of people are running vulnerable, outdated copies of Joomla! 1.5.x. Keeping your Joomla! site running with the latest patches is a MUST. The Joomla! core team, working groups, security team, and bug squad all jump in and help write a patch whenver a vulnerability is discovered. However, these patches do no good if they are not applied to your site.
So how do you stay on top of Joomla! security issues and releases? The download page for Joomla! now has a handy form where you can sign up for email alerts. If you prefer RSS, use this feed link. (BTW: the current version as of this writing is 1.5.7, with a 1.5.8 maintenance release around the corner.)
Listen to The Joomla Podcast
Mike Brogan has started a podcast about Joomla! simply called The Joomla Podcast. He’s been regularly releasing episodes over the past couple of months and is now up to #6. The show is a good balance between project news, component reviews, tips, and Mike’s own two cents. Anyone who’s a fan of Joomla will get something out of the podcast.
I’m getting caught up on it as I write this blog post
.
Joomla! vs. Drupal vs. Wordpress
Lynda.com now has videos available on the most popular open-source programs for publishing content. There’s the one on Joomla! I recorded, one on Wordpress by Maria Langer, and now one on Drupal by Tom Geller. So which one is right for your next site? Sign up for an Online Training Library account today and find out!
For $25, you get a month-long subscription where you can watch all of our videos in their entirety and as many times as you wish. You will also have access to the rest of the video library which covers topics like Flash, HTML, Photoshop, CS3, and Search Engine Optimization. Use Lynda.com to learn everything you need to know for launching your next site!
UPDATE: As Maria pointed out in the comments, you can watch the first few videos of each Lynda.com title for free. This will give you a general feel for each system.
Reviewing Habari
Yesterday, I decided to install the blogging software Habari on my computer to see what the buzz was about. Overall, I’m impressed with the system and I think it shows a lot of promise for the future. It’s all written in modern PHP 5 (5.2 is the minimum) with PDO so you are not tied to MySQL. Installation was very easy (after I added FollowSymLinks to my .htaccess file). The backend is slick and powered with keyboard shortcuts. Performance seemed fast, but a localhost environment doesn’t really give you a good measure of this so YMMV.
My only complaint about the system is one that I also have with WordPress: the theming system breaks everything into entirely too many pieces. Tags open in one file and close in another. Loops are all over the place. You have to create a class in theme.php to pull in and assign data to the theme. This will certainly difficult for most designers to get their heads around.
I’m definitely a fan of Joomla!’s templating system. While Joomla! is a more general-purpose content management system and Habari is focused on blogging, I think the overall concept could be ported. In Joomla! templates, you have all of the essential markup from <html> to </html> in one file. Within this file, you add named placeholders (bottom, left, right, main, banner, etc…). What goes into these placeholders is determined by the admin of the Joomla! site. This makes it easy for admins to rearrange the elements to suit their desires, while template designers need not touch a line of PHP. In Joomla! templates, desigers can rely on the default core output, then override specific elements only when necessary.
Habari is still in alpha (version 0.6), but it seems to be maturing very quickly. If you’re doing blog sites and are up for something new, definitely give Habari a test. I’m looking forward to the betas and stable copies, but hope that the templating can be simplified drastically.
Joomla! 1.5 Essential Training, now live!
Recently, I recorded a Joomla! 1.5 video training series for Lynda.com. As of today, the videos are now live! This video series walks you through installing Joomla!, adding content, creating navigation, and adding extensions. You can sample some of the first videos on the site before subscribing to the Online Training Library.
JoomlaEXPO ‘08 wrap up
The first JoomlaEXPO was held this past Friday in Chicago. We had a full house with 251 people attending.
We had three sessions on Joomla! coding (including mine) that each focused on a different aspect of Joomla! programming. My session was on the differences between coding in Joomla! 1.0 and 1.5, highlighting some of my new favorite features. (You can download the PowerPoint slides here.) Azrul then followed up with a full presentation on how to create SEF URLs for your component while avoiding some common SEF URL pitfalls. Steve talked about different framework features and debugging tools, then unveiled his Community ACL component.
I was also able to hear Victor Drover’s session on GPL software business models. He’s currently using a hybrid model where he sells access to his site and also does consulting work. His main point was that chasing down software pirates is a waste of time, so make it a moot point by offering your software under the GPL.
The one thing that struck me about this event was that the third-party developer community was very well represented. However, no one group totally dominated the conference: we a had a good mix of template designers, website producers, system admins, hosts, programmers, and Joomla! users. At the beginning of the event, we were given a set of color-coded stickers to identify ourselves. In a community as diverse as Joomla!’s, this was definitely helpful!
Special thanks goes out to the conference organizers. I know firsthand that putting together an event of this type takes a lot of effort and persistence. This one was very well attended for a first (or even a third) year conference and I’m already looking forward to the next!
UPDATE: Now you can see the presentation below:
