Category Archives: MODx

Installing MODx (MODx Series Part III)

Here’s a video of me installing the MODx content management system. In case it wasn’t clear why I was doing this series, I REALLY like MODx and I find it the easiest CMS to work with both as a PHP developer and as a front-end designer. The video is my small contribution to make it easier to install this nifty CMS, and sometimes less is more. There are already a lot of high quality resources available for anyone who wants to try out this CMS. See the references below.

A video used to be embedded here but the service that it was hosted on has shut down.

References

There are already a lot of resources available to help people install MODx. Here is a list of what I feel are the most useful:

Download MODx here: http://modxcms.com/downloads.html (obviously, you need to be able to download it before you do anything else)

Official Documentation: http://modxcms.com/installation-and-configuration.html

Wiki: It’s a wonderful resource with a whole section for installation. http://wiki.modxcms.com/index.php/Category:Installation

Bob’s Guides: http://bobsguides.com/installing-modx.html — Bob is very active in the MODx forums and he knows what he’s talking about.

Bits of Wisdom

  • Write down your database name, user, and password. These are the 3 keys to the kingdom that many CMS applications depend on. If you ever forget a password or get into some sort of trouble with the app, you’ll need this information. I recommend storing it in a safe place, as discussed by one of our previous articles on KeePass
  • Install the Sample Web Site. Yes, if it’s your first time, you can learn a lot by looking through how the sample site works. Go ahead and break it. Demolish it. It’s really easy to install it again.
  • Visit the Wiki. Some people (including myself) have spent hours creating pages with details and instructions for overcoming a number of problems. The MODx Wiki lives here.

Problems Installing MODx

Nearly all the problems I’ve had in the 20 or 30 MODx installations that I’ve done have stemmed from webserver permissions. Basically, Apache needs to be able read every file and write to certain directories. MODx is very verbose about which files and directories it wants to see, so this is usually easy to fix.

The other problems I’ve run into have only been on dedicated servers that I setup. I’m not a Linux guru (well, except in those really wild fantasies where I’m on a Lear jet with scantily clad foreign courtesans), so some of these “problems” are more like “no-sh*t-Sherlock” annoyances for those with more experience, but they’ve boiled down to simply installing the correct PHP modules.

New Overview of MODx (MODx Series Part II)

A while back I did a brief overview of the MODx content management system. Well, I was asked to do a high-resolution video so you can see what the manager interface looks like and you can get an idea of why you might want to choose the MODx content management system for your next web site.

A video used to be embedded here but the service that it was hosted on has shut down.

Overview

Publish/unpublish a document by right-clicking the document:

Right-click a document to edit it
Right-click a document to edit it

You can set publish/unpublish dates by changing the Page Settings:

Set the Publish/Unpublish dates in the Page Settings tab
Set the Publish/Unpublish dates in the Page Settings tab

Build your own templates or use existing CSS and HTML by adding simple placeholders to the code. Just paste the HTML page into a new Template.

Sample of a MODx Template:


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[*pagetitle*]</title>
<meta name="description" content="[*description*]">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link type="text/css" media="screen" rel="stylesheet" href="/assets/templates/uncomplicated/style.css" />
<base href="/"/>
</head>
<body>
<h1>[*longtitle*]</h1>
[*content*]

Where you put the [*placeholders*] is somewhat arbitrary, but the above example is how I usually put together my templates. It’s just important to remember how the substitution works. The text in the “Title” field will replace the [*pagetitle*] placeholder tag.

Here’s a graphic I made to demonstrate how the values in the editor are substituted any instances of the placeholders in the template. MODx offers the easiest templating I know of. Stay tuned for a hi-res video illustrating how you can take an existing HTML/CSS layout and turn it into a MODx template… for now, only the low-res video is available.

MODx uses simple placeholders for templates
MODx uses simple placeholders for templates

MODx also allows you to add custom fields to any document, but that’s a more advanced topic… stay tuned.

Requirements

The requirements for MODx are quite similar to the requirements of other CMS’s.

  • PHP (4.4.x or above)
  • MySQL (4.1 or above)
  • Apache with mod_rewrite (used for friendly URLs)

Advantages

  • Document Tree. Using other CMS’s it can be difficult to locate content. “Where was that legal notice? I know the URL, but I just can’t find the content to edit it!” MODx makes it easy to find and edit your content.
  • Isolation of Responsibilities. It’s very simple to isolate roles so a team can work on a site: content folks can login to the manager and edit content, front-end designers can build HTML and CSS templates that integrate EASILY into MODx without a steep learning curve, and PHP developers can write code, and each of these separate groups can work in their respective areas with very simple overlaps.
  • Simple Templates. There are no special logical tags to learn for templates; PHP scripts can be saved directly in the database and called from any document. Not all CMS’s provide this kind of isolation, and no other CMS makes it as easy to use existing HTML and CSS layouts.
  • Dynamic Menus. They make it easy to move content around your site, and menus will generate themselves automatically!
  • Speed. All CMS’s are slower than a static site, but MODx is one of the faster CMS’s that I’ve seen using load time benchmarking.
  • Small database footprint. You can get a hundred pages on your site and end up using only a few megabytes in your database. Other CMS’s use much more space in the database.
  • Extendable! It is insanely simple to add existing PHP scripts to MODx.

Limitations

As much as I like MODx, it may not be the best choice for your particular needs.

  • 5000 page limit. The new version of MODx will support more, but if you have more than 5000 pages on your site, MODx may not be for you. There are work-arounds, however…
  • Open-Source. If you are in a corporate environment and you NEED to have someone on-call for help resolving technical problems, then you should probably look for a different CMS. MODx is open-source. The forums are a great place to get help, but there is no dedicated support staff.
  • Versioning. Some CMS’s offer rollback features for the content in your templates or posts (similar to giving you levels of “un-do”), but the current version (0.9.6.3) does not offer this by default. You can add this functionality, but it is not built-in; it is slated to be included in the next version of MODx

Summary

I hope that the video gives you an idea of what this content management system looks like. Hopefully you can see how you might use it for one of your own projects. Don’t forget the MODx Wiki and the MODx forums for additional resources. Stay tuned for more videos.

Content Management Systems (Prelude to MODx): Part I

Introduction to Web Sites, CMS’s, and MODx

MODx lets you take control...
MODx lets you take control...

Some of you may remember the little article I wrote a while ago about content management systems where I shared a bit about MODx. What is MODx? (pronounced like “modular”… and it’s eXtendable… get it?) It’s a content management system (CMS), and it’s used to help you manage and publish web sites easily. It’s very cool, and it is very flexible… but I’m getting ahead of myself. I want to spend some time with our readers and talk a bit about web sites and CMS’s and use that discussion to segue into an upcoming video series about MODx. If you already know what MODx is and you want to learn about it, stay tuned for the upcoming videos… if you want to read a nice walk-through, check out NetTuts recent article.

Web Sites 101

If you’re reading this, you should have some idea of how this is happening… in the interest of the stringent word count limitations imposed by… uh… Brian (?)… I’m going to assume that you understand the concepts of a domain name, a web server, and how a traditional request such as “http://www.tipsfor.us/some_page.html” is handled and a page is read and returned to your browser. You with me? Great.

Higher Education: Dynamic Web Sites

A static site grabs a file from a folder and displays it to the browser, whereas a dynamic site operates a bit more like the “printing on demand” technology. Many sites (including this one) rely on dynamic technology to serve up a page… the page that you are requesting may not even exist until you request it. The “page” that you end up reading is often assembled on the fly from a series of scripts and bits of text from the file system and/or from a database.

Making Web Sites: The Perils of Static Sites

Coding Sites by Hand is Perilous
Coding Sites by Hand is Perilous

We all start out bald and naked, filling diapers and making static web sites. As you get older, you learn a little more HTML, and your “<h1>Hello World</h1>” progresses to animated GIFs and maybe some CSS and Javascript, but some people take a long time to mature out of static web development. And not unlike growing up and leaving home, there’s a profound turning point in your web education that propels you out of static land. Let’s say you want to change the name of one of your pages from “articles/cool-stuff.html” to “articles/archive/cool-stuph.html”. You have to move the document and change its file name, then you have to wade through all the pages on your site and update any links or menus. It’s only palatable if you have a few pages. If you have more than 10 or so, this scenario quickly becomes cumbersome and prone to error… you’ll be wanting to ask mom to do your laundry.

Another not-so-hypothetical situation arises when you want to change the look and feel of your static site. If you’ve followed the rules of semantic web development, you’ve separated your content from its formatting using CSS files and well formed HTML (check out CSS Zen Garden), but it can still be tricky if you’ve got to change Javascript files to make menus work. And you still have to know a lot about HTML and FTP logins to make these changes.

Enter Content Management Systems

If your own learning curve of web site development has roughly followed the previous descriptions, then you can appreciate that someone found a better way to do things. You can have your cake and eat it too.

Benefits to using a CMS

  • — Isolates content from formatting (it’s much easier to search content and update templates)
  • — Editing content is easily done via a GUI
  • — Roles and permissions can be established: e.g. an editor, an admin, a blogger all can be allowed to do certain things to a site.
  • — Links between documents can update automatically (with most CMS’s)

A CMS allows you to forgo the FTP client and use a front-end interface so that users can edit documents and templates. A CMS usually has editing tools built right in, so you don’t even need to know HTML to edit the content of a page — this is great if you’ve built a site for someone else. You can be the HTML genius, but you can give them the key to the CMS and they can edit and add content all day long. Finally, a CMS provides the ultimate separation between content and its formatting. This means that the text of an article can be fully isolated from the template used to display that article, and then the task of switching layouts for an entire site of thousands of pages becomes a trivial affair. Changing the “location” of a file or its name is also dynamically rendered so it can be done in an instant. These are the benefits to running a site using a CMS.

Down Sides to CMS

  • — Complicated to set up. Math is hard! Let’s go to the mall!
  • — It’s more resource intensive. Serving up flat files is much easier for the web server.
  • — More complicated server requirements: not all hosts will have a scripting language and database available to you.
  • — More bandwidth is required.

A site running a CMS is almost never as responsive as a site simply serving up static files. A CMS has many more moving parts, so it’s more likely to break or be attacked. You can’t do much to thwart the display of a simple HTML file, but you can experience all kinds of malicious attacks on a database an your scripting language of choice.

In my opinion, in most circumstances, the benefits often far outweigh the drawbacks. You make some extra backups, you take a few extra precautions, and bamm… you can be pimping out your web site in CMS style, and once you’ve done it that way, you’ll never go back.

So now you know why you might want to use a CMS for web site development. In the next article, I’ll discuss why you might want to choose MODx over some of many other systems available. Lots of systems will alleviate some of the pain and stress of static development, but not all Content Management Systems are created equally. The dudes working hard on MODx have made a really cool application that makes life so much easier for developers and content editors, and one of the founders asked me to upload some high resolution videos about it. Thanks guys. Stay tuned…