January 14, 2008

MODx: A promising open source CMS

Author: Chen Nan Yang

MODx, an open source content management system (CMS) and PHP application framework comparable to WordPress or Movable Type, recently won Packt Publishing's Most Promising Open Source CMS award. The application works with either Apache or Internet Information Services (IIS) and supports almost any browser.

Install MODx

MODx requires that your Web server have PHP and MySQL installed. To install MODx, download and unzip the latest MODx version to a folder on your hard drive. FTP the unzipped files and folders in the MODx directory (e.g., c:\temp\modx- to the root of your Web site, then open http://yoursite/install/index.php to begin the installation process, where yoursite is the URL of your Web site.

Select your language (English, French, German, Russian, Spanish, or Swedish), agree to the license terms, and choose whether you want to start a new installation or upgrade an existing install. If you're upgrading, be sure to save all your unique or customized files, such as images, Cascading Style Sheets (CSS) files, and custom snippets, and back up your database before you continue.

Enter your database connection and login information, and if you have one, enter the name of the database you created for MODx. If you don't have a database yet, the installer will attempt to create a new one. This may fail depending on the MySQL configuration or the database user permissions, in which case you may need to contact your Web hosting administrators.

Next, create a default MODx administrator. Specify an administrator account and a password, which you'll need to log in and set up your Web site after installation. Choose optional items, including various chunks, plugins, modules, or snippets, and click Install. You're taken to the pre-install validation page, which carries out a number of checks to see if everything is ready for the final installation. If everything works correctly, you'll see "Installation was successful!" After installation, delete the install folders (e.g., http://yoursite/install/) for security reasons.

Set up and manage your Web site

MODx is easy to use, but if you want to do a little customization, you'll need some knowledge of HTML, PHP, and CSS. To log in and begin managing your Web site, go to MODx CMS Manager at http://yoursite/manager/index.php and enter the administrator account and password. Go to Site -> New Document to create a new Web page. You can create content, choose a template, decide when a page will publish, select metatags or keywords, and more. To edit an existing page, click the page title in the left panel of the MODx manager.

MODx lets you select metatags and keywords on every Web page that you create or edit, which helps with search engine optimization (SEO). To add new metatags or keywords for selection, go to Resources -> Manage META tags and Keywords.

Templates make it easy for you to control the layout and appearance of your Web site. MODx's templates are HTML documents that contain special MODx tags, which are replaced with specific content when you generate the page. If you don't like an existing template, you can edit it or create a new one in Resources -> Manage resources -> Templates.

MODx offers a flexible template system and elements such as chunks and snippets to help you control the structure of your Web pages. Chunks let you reuse blocks of code or HTML on your Web site. For example, you can incorporate them in a template as repetitive footers, addresses, contacts, copyright information, and so on. Go to Resources -> Manage resources -> Chunks to customize chunks.

Snippets are pieces of PHP code that you can incorporate into templates for adding dynamic behaviors to your Web site. For example, you can use them to create menus or determine who is logged in. Go to Resources -> Manage resources -> Snippets to customize them.

With templates, chunks, and snippets as building blocks, you can focus on the design and content of a great Web site, not on the tools that build them. These items can be nested in various ways -- for example, templates might contain chunks, chunks might contain snippets, and snippets might run inside of other snippets.

MODx also offers template variables, which you can use for such things as an always-present floating display box, such as a marquee or a ticker, that scrolls or changes content on your Web site. You can use modules to group a set of subprograms and data structures to promote encapsulation (i.e., information hiding) through a separation between the interface and the implementation.

MODx provides a range of administration tools. It lets you manage site security by specifying users, roles, and permissions. You can create or edit roles with various management levels for content, template, snippet, chunk, plugin, module, and permissions, and assign users to them. You can use the Tools menu to back up or download selected tables, import an entire HTML site into the database, or do system configuration. From the Reports menu, you can see the detailed log of the Web site.

MODx's administration interface integrates almost all the functions together. The AJAX interface make it easy to navigate and use; the tree-style layout help you managing not only the pages, but also other contents as well.

With MODx's excellent flexibility, you can get unlimited control of the design of your Web site.

You can read more about MODx's functions in the Developer's Guide.


MODx is an easy-to-use, standards-compliant, search-engine-friendly, functional, and extensible CMS. Some developers complain that the MODx community doesn't offer enough support. However, with version 1.0 looming, expect improved performance of this Most Promising Open Source CMS winner.


  • Internet & WWW
Click Here!