nooshu - Matt Hobbs' Web Development Blog

Kneeling on the shoulders of giants

Category: CMS

Posts relating to the use of Content Management Systems; their implementations and plug-ins.

Drupal Love! Stuff I’ve learnt!

I created a post a couple of months ago about how I was learning Drupal for an up and coming project; well that project finally went live this week. Huzzah! It wasn’t all smooth sailing; there was lots of trial and error, head scratching and a few mini panics, but I got there in the end. It’s amazing what you learn over the course of a project. Any future Drupal projects will be so much quicker and easier to setup due to the fact that I now actually know how to use Drupal!

So anyway here are a few things I learnt along the way:

  • There are some very simple yet powerful templating rules you can use to style your website. Learning how they work will really help you style specific pages and blocks.
  • Looking for some functionality that is missing by default? I bet there’s already a module that does the job. Check out Drupal modules, this excellent website lists and rates thousands of Drupal modules which you can install and use.
  • If you do find a module that adds the functionality you need, double check that there aren’t other modules about that do it better. Since Drupal has been around for some time, many modules haven’t been updated in quite a while so they may just be occupying the name space. It’s always best to check before you dive into using one particular module as it may not always be the best route to take.
  • Learn how to use the Content Construction Kit (CCK). If you are missing a type of CCK field, look for an additional module; I’m sure there will be one you can install that does the job. You really can make content types do anything you want with CCK.
  • Learn how to use the Views module. I really can’t express this point enough. The Views module is without a doubt one of the most powerful additions to any CMS I’ve ever come across. With it you can take any content and display it however you like on a page. The layout is a little intimidating at first, but once you get your head round it you will have a dynamic site up and running in no time at all.
  • Install the ImageCache module. It ties in with both CCK and Views allowing you to upload and display images on your site however you need to. If you add a new image preset the module will automatically iterate over old images so you never have to go in and manually adjust images if you change your site design / functionality.
  • One thing I missed from Drupal was the ability to add parent / child nodes. Luckily theres a module called Node Hierarchy that will add this functionality. It even handles the breadcrumbs and Views for you. Note: Make sure you don’t have ‘Taxonomy breadcrumb’ enabled with Node Hierarchy as the breadcrumbs won’t work. I learnt that the hard way!

Hopefully other budding Drupal users found the tips helpful. I’m still a Drupal novice, but now I know the basics the site possibilities are endless.

Looking for a new CMS for small websites

Recently I’ve been looking at other small CMS solutions for future projects. For a while now I’ve been using Frog CMS; unfortunately development seems to have stopped which is a shame. At the weekend I stumbled across quite a major security concern with Frog involving a Cross-site request forgery (CSRF). Using Google it is even possible to find ready to be used scripts (which I won’t link to here). Being hacked using CSRF is unlikely to happen as it requires a user who regularly uses the site to click on a rogue link, but even so it’s quite concerning.

Now I could keep using Wolf CMS (which is a variation on Frog) but my thoughts are why keep all your eggs in one basket. If Frog is vulnerable then its likely that Wolf will be too. So time to look about for a new small CMS.

The CMS will be used for very small websites (5 – 20 pages) where MODx, Drupal and WordPress are just overkill; It gets updated regularly and is based on PHP / MySQL. I’ve been having a search and have found a few that look really promising:

Textpattern

Very clean looking CMS (love the typography on its homepage… not that it matters) and having tried the demo I can see the admin interface is simple to use and all the features are easy to find. I think the admin area needs a little work in terms of design, but the comments on Opensourcecms all seem to be very positive so I’ll definatly be installing it locally and having a closer look.

Text pattern homepage

A flexible, elegant and easy-to-use CMS. We shall see!

Concrete5

Another interesting CMS, the video on the homepage makes it look like some sort of action movie, maybe a little over the top but whatever. I was unable to find a live demo of the CMS unfortunately, but the screencasts from the video looked very promising. There’s also an option of Concrete5 hosting the CMS, which removes the (sometimes) tricky setup process; great for non-technical people.

concrete5 homepage

Dramatic homepage video, but how well does it work? Live demo please!

CMS Made Simple

Of the new CMS’ I’ve looked at CMS Made Simple is my favorite. The live demo looked good with a very intuitive administrator area. Some of the comments on Opensourcecms were quite negative; so I’ll have to do some testing of the installation and template system before I commit to building a live site with it.

CMS Made Simple homepage

Some negative comments but it looks very promising.

For my next small project I’ll be using one of these small CMS’, but which one will it be? When i decide I’ll be sure to update you. Got any other suggestions? Why not leave a comment.

New to Drupal? Here are a few helpful links

For the past week or so I’ve been expanding my horizons and started using a new CMS (to me at least), it’s name is Drupal. Now Drupal has been around for many years, originally known as ‘Drop’ until it was renamed to ‘Drupal’ in 2001. The CMS is now on version 6 (with alpha versions of 7 available from the download page). As I’ve only just started using this extremely powerful CMS I thought I’d put together a quick list of links and tips of what I’ve learnt so far. Hopefully other beginners like myself will find them useful.

Screencasts

  • Lynda.com: I can’t stress enough how useful Lynda.com has been while learning Drupal (or any other piece of software for that matter). It has 3 superb sets of screencasts available that will take you from a complete beginner a fairly competent Drupal developer. They aren’t free but they are well worth the money!
  • Learn by the Drop: Another set of brilliant screencasts that you can use to get up to speed on how to use Drupal. The site contains both premium and free videos for the ‘want to be’ Drupal developer.

Websites

  • Stack Overflow: Now I know this is a bit of a catch-all site as it can be used for any programming language, but you will often find many questions you have, have already been answered on Stack Overflow. The Drupal specific questions are available here.
  • Drupal Snippets: Drupal Snippets is a whole site dedicated to…. erm… snippets for Druplal. I must admit I’ve yet to use the site, but I bookmarked it as soon as I found it as I’m sure it will come in extremely useful after learning the basics.

Modules

  • CCK: Download and install this module and developing dynamic websites in Drupal becomes so (so!) much easier. CCK (Content Construction Kit) is a module that expands Drupals native Custom Content Types functionality opening a whole world of possibilities for your site and users. In essence CCK makes it easier to ‘push’ data into your site in any way you see fit. It’s even being included into the core of Drupal 7.
  • Views: Over the past couple of days I’ve been blown away by the power and versatility of the Views module. Where CCK is used to push data into your site database, Views ‘pulls’ the data back out and display it in any format you like. It’s quite intimidating at first as there are tonnes of options and settings, but once you get your head around it, the Drupal world is your oyster. A free screencast on how to use it is available here.
  • Pathauto: Coming from WordPress I’m used to its fantastic permalink functionality, once setup it just works. Drupal doesn’t seem to come bundled with anything similar (please correct me here if I’m wrong!) so installing the Pathauto module will plug that gap. The module automatically generates a path for various content types without you having to worry about it.

Themes

  • Zen: If you are a Front End Developer like myself you will be wanting a solid foundation with which to build and style your site. You could just edit one of the bundled themes if that’s your thing, but I prefer to start a fresh. The Zen theme is a fantastic theme with which to base your styling off. One big tip, don’t edit the main Zen folder, create a sub-theme by following these directions (I learnt that the hard way).

So there you go, hopefully fellow Drupal beginners will find the links above useful. Any that I’ve missed off or that you’d recommend? Leave a comment below.

NextGEN Gallery + WordPress custom fields = happy developer

Over the past couple of weeks I’ve been working on a number of WordPress projects, all of which have needed some basic photo gallery functionality. As I’ve mentioned before in previous posts, NextGEN gallery is my WordPress gallery of choice, there really is nothing that comes close to it in terms of features and customisation (that I know of, if there are others post a comment!).

To add a gallery (or album) to a post / page is as simple as adding ‘[ nggallery id=x ]‘ to the post content… super! One issue though… what happens when you allow a client to edit and add new pages; well what usually happens is the tag gets deleted or changed, the gallery breaks, client panics and the virtual world ends (well not quite, but close). A technique I have been using to help solve this issue involves using WordPress custom fields and the excellent Get custom field values plug-in. You can grab the custom field values directly from WordPress using get_post_meta() but the plug-in makes it much easier.

Digging through the nggfunctions.php file in the NextGEN gallery plug-in folder reveals a whole host of useful functions that can be easily called directly from inside your WordPress theme. So say you wanted a gallery in a post page, but didn’t want the client to have to remember ‘[ nggallery id=x ]‘ every time, simply add this code next to your content in the single.php file:

1
2
3
4
5
6
<?php
    if(c2c_get_current_custom('galleryID') != ''):
        $gID = c2c_get_current_custom('galleryID');
        echo nggShowGallery($gID);
    endif;
?>

Add a custom field of galleryID with an integer value linking to the relevant gallery and you’re done. Now the client can pick out the galleryID custom field from a drop-down since WordPress remembers the custom fields used. Much easier for a client to remember than adding the tag every time.

I highly recommend looking through the nggfunctions.php file, here are just a few functions that are available:

  • nggShowAlbum(): Show a whole album depending on the ID.
  • nggSinglePicture(): Show a single picture from an ID.
  • nggShowRandomRecent(): Show random image(s) from a certain gallery.
  • nggShowSlideshow(): Show a flash slideshow pulling images from a specified gallery.

I have used nggShowRandomRecent() quite a few times in the past few months, here’s a quick example:

1
2
3
4
5
<?php
    //Show 6 random images using 'my-template' from gallery 4
    //(order, number of images, template, gallery ID)
    echo nggShowRandomRecent('random', 6, 'my-template', 4);
?>

Pick 6 images at random from a selected gallery on page load, very simple and effective.

Note: When using the random images function make sure you don’t have any WordPress caching plug-ins running on the selected page, else it won’t work as the page gets cached on first load. It took me a good 15 minutes to figure out why the function had suddenly stopped working due to this slight oversight.

Wolf CMS: A fork of Frog CMS

I’ve written about my Frog CMS usage in previous blog posts; where other CMS’s can be a little overkill for small websites, Frog CMS fits perfectly into the gap. Unfortunately as much as I like Frog, the development seems to have stopped. The last stable version was released on the 26th April 2009, over a year ago. There’s no need to panic though, a development fork has been created called Wolf CMS which is building upon this superb little CMS and making it even better!

At the moment there’s very little difference between Frog and Wolf as you might expect, so migrating from one to the other is fairly simple, a wiki page has been created with instructions on how to do this. As it says on the page it’s probably best to decide between the two versions now since there’s still little difference between them, but this could change in future versions (version 0.6.0 introduced a number of large changes). So there may be a point where it isn’t (easily) possible to jump between the two versions.

So what are the differences at the moment? When version 0.6.0 of Wolf CMS was released on the 1st February it added a new core plug-in called ‘BackupRestore’, allowing admin users to easily backup the Wolf CMS core DB tables. I’ve been using an external plug-in to do this on sites I built, so having this feature added as a core plug-in is nifty addition. Other features include:

  • Admin users can now uninstall plug-ins, including the db tables
  • HTTPS Support added to the admin area for greater security
  • You can now preview a page before it is published

It’s great to see that such a useful little CMS hasn’t been left to stagnate and die out, the roadmap for Wolf CMS looks promising, so fingers crossed it has a bright future ahead of it. I think it’s time to migrate my Frog websites over to Wolf…

Currently on page 1 of 212