Picseli.co.uk

Tuesday, 11 January 2011

MODx Revolution Tutorial for beginners – Part 1

IntroductionAbout 18 months ago, we stumbled upon a content management system called ‘MODx’. It sounded pretty fancy, so we took a closer look.

MODx is an open source, powerful PHP Content Management Framework. It does not include any constraints to the designer or developer, but it does have some fantastic add-ons and extras which make the process of building a website much quicker.

Some HousekeepingOne of the main advantages of MODx is the fantastic support and documentation that’s available. So before you get into anything too complex, be sure to check out the forums at http://modxcms.com/forums/index.php and also the brilliant documentation at http://rtfm.modx.com/dashboard.action. Both of these will be invaluable when you’re working with MODx.

Downloading MODxFirst off, you’ll need to go and download MODx. So go to http://modxcms.com/ and you’ll see a big banner, like the one below!

Make sure you grab the latest stable version of MODx Revolution. The development team for MODx are continuously improving MODx, so the most recent version will be the most advanced.

Once you’ve downloaded it, you’ll need to open up your favourite piece of FTP software (we’re rather fond of Filezilla which you can grab from http://filezilla-project.org/). Then, simply unzip the downloaded file from MODx, and upload it to the root of your web server. There are a few thousand files that need uploading, so you can use this time to go off and set up your database!

Database SetupNow one thing we need to note here is that we use a Microsoft Web Server (IIS 6.0). This has caused us quite a few headaches in the past, specifically with MODx, but that’s not the fault of MODx, more the fault of our server. Having said that, we’ve never come up against a problem that we couldn’t solve, but I felt it should be noted nonetheless. If you’re using an Apache web server (which you probably are, but you can find out easily enough by contacting your web hosts) then you won’t have any problems with things like Friendly URLs.

So, you’ll need to set up a database for MODx to play with. Depending on your server, this is usually a straightforward process. In order to get through the MODx installation process, you’ll need to know your database name, your database username and user password.

Installation Once your database is all set up, and MODx has finished uploading to your web server, you’re ready to go and start the set up process. So go ahead and open up a browser window, and navigate to http://www.yourwebdomain.com/setup. You should then see the MODx set up screen!

Ok, so all good so far. The first screen you see is where you need to select your language. By default, its sent to English so for the majority, you can just leave it as is, and click the ‘Select’ button.

Click ‘Next’ on the following screen, until you reach the ‘Install Options’ screen. In order to carry out a fresh installation of MODx, you can leave all the options as they are by default, and click ‘Next’. The other options on this screen relate to upgrading an existing install, and thats something that will be covered in a future post.

Remember when you set up your database earlier? Well now it’s time to configure MODx to work with it. In all but exceptional cases, you will be working with a MySQL database, and your database host will be ‘localhost’, so you can usually leave the first two entries as they are. Next you’ll need to enter your database user login name, and the password for that user, and then enter the name of the database. You can leave the table prefix as it is, and click to test you database connection. If a message tells you that it can’t connect, you’ll need to go back and check your database details. Otherwise, you should get a message telling you that it’s connected successfully.

Next you’ll need to choose your character set and collation. For this, we use utf-8 for the character set, and utf8_unicode_ci for the collation. Again, the database needs to be tested before you can continue. Hopefully all will be well here, so we move on!

Now it’s time to select you Administrator username, e-mail address and password. This is the username and password that you use when you login into the admin section of MODx (which you’ll be doing a lot!) so make sure you use something memorable, but secure. Make a note of the username and password you use here, because you’ll need them again soon! Also, use a valid e-mail address that you have access to, because this is where your e-mails will go if you happen to forget your login details.

Now it’s time to install MODx. For peace of mind, your installation screen will show you if every part of the installation has gone smoothly, and if there are any warnings.

Presuming everything is ok so far, (we’re almost done!) it’s usually a good idea to remove your setup directory (you won’t need it again) by ticking the checkbox and clicking the ‘Login’ button.

You should then be shown your login screen. Remember where I told you to make a note of your username and password? Well, if you did, this is where you need to use them! Enter your details here, and presuming they’re correct, you can login, and you’ll have your first look at the MODx administration screen. Exciting!

One important thing to note, is that when you first navigate to your site domain to see what it looks like, it will be blank. This differs from MODx Evolution which would install with a demo site. If you wish, you can install a demo site for Revolution to help get you started from the Package Management screen in the Manager. Installing add-ons will be covered in a future post, but if you've any immediate questions, feel free to comment below!

Congratulations! That’s it, MODx is all installed and configured. In our next post, we’ll go over some of the basic set up features when you’re building your first MODx website! The next few posts will be much more interesting as we delve deeper into what MODx is all about. I promise magic, whizzing and bangs! So be sure to come back for the next post.