le.cms Overview

A CMS for maximum enjoyment of life

This content management system takes a 'back to basics' approach and enables content to be published to the web remotely and as easily as possible. Deliberately, it's just one step up from creating and uploading pages from the local machine. It will especially suit a webmaster who:

A database is not required, and the CMS consists of only about 30 files, including a startup homepage, a contact page, a custom 404, robots.txt, and .htaccess. The number of files obviously increases as new pages are created, but simplicity remains the key. The php code generated for a typical page (eg "mypage") is little more than (for eg: mypage.php):

include ('class/template.php');
$mypage = new Page;
$filename = "text/mypage.txt";
if (file_exists($filename)) {
  $file_contents = file_get_contents($filename);
  $file_contents = autop($file_contents, 0);
  $file_contents = convert_chars($file_contents, 0);
  $output = $file_contents;
} else {
  $output = 'No file.';
}
$mypage->Title = "My Page";
$mypage->MetaDescription = "This is my page.";
$mypage->MetaKeywords = "keyword1,keyword2";
$mypage->ThisPage = "mypage";
$mypage->SetContent($output);
$mypage->Template();

This gorgeously simple code outputs a standards-compliant HTML web page with a template that consists of only 5 layout 'boxes' and validates nicely to W3C XHTML 1.0 Transitional.

Creating new pages

New pages are created by entering into a form:

These values are passed to the new mypage.php code, as in the code example above. At the same time a new 'instance' of the standard Page template class is created, in the form of a php object named "mypage".

Initially, the new page contains no content. The content is read from a text file text/mypage.txt that was created at the same time as the new page, but the text file doesn't yet contain any content. This can now be written into the empty text file using the "write" page in the admin section, and will then appear when the page is viewed.

That's all there is to creating new pages.

Building the navigation menu

Intentionally, the creation of a new page does not automatically add a button to the navigation menu. Adding new buttons is a separate but simple process, using the "Add to Menu" admin page.

A new page can therefore be built and tested before it's made live via the menu. The text that appears on the button is fully editable, and with simple 'cut and paste', existing menu buttons can be moved up and down within the menu, giving complete control.

Note that the menu system ensures that the button for the current page is highlighted and is not a link to itself.

Obviously the menu shouldn't be too deep. Sub-page links can be added within the page content or by the creation of a secondary menu, again within the page. The simplicity of the CMS means that all pages are inside the root folder - well, actually they're not, but as far as the visitor is concerned they appear to be so.

All the pages except the homepage are in fact located in a subfolder, but the .htaccess file ensures that no subfolders appear in page URLs. Page URLs also contain no file suffixes - they are 'permalinks'.

Optional extras

In addition to the content box and the navigation menu, two additional "boxes" are available as optional extras: random snippets, and site search. In the page code they are located beneath the navigation menu but they are independent of other boxes and can be styled to appear anywhere in the page layout.

See optional extras for more information.

Why is it called le.cms?

All content management systems have a name, so it seems. Some names are good (WordPress) and some less good (meaningless: Drupal, Mambo, Joomla). Rather than call this one "The CMS", I've named it le.cms. A small name for a small system.

With a just a few new images and a very minor change to the stylesheet, the pages can be given a completely different look...

Read more »