Search Our Web Design Blog...

Wednesday, May 30, 2012

LilCMS

First click here to download Lil' CMS. It's only 2 kb :) All that you'll find inside the archive are lilcms.php (CMS itself) and readme file. If you want to take a look at the code right now, here it is.

This is version 1.1 with "slashes bug" fixed (if you tried v1.0 you know what it is). There aren't any bugs any more, as far as we know.

Before everything, you need to know that pages with editable text need to be either PHP or SHTML. As for PHP any version would do and as for SHTML (extension that implicates that your web page uses server side includes), what you'll do is really basic and should work with literally any web host.

We recommend you first try with PHP extension. There're many handy php snippets around and you may want to use them with your site later -- in that case you will not need to change anything. In both cases (php or shtml) you will not need to insert any special code in order for them to work - any html page will work just fine if you rename it to .php or .shtml, these extensions are only notice for web server that maybe some dynamic code is inside too.
On to the installation! First create the following folders in the root (that's where your html/php/etc pages are) of your web site:

backup
content
cms

Now open TextEdit and create text documents with content that will be editable. For example:

introduction.txt
news.txt
footer_text.txt

Put them all in the content folder. Set their file permissions to 777 (this is very easy, every FTP client features Change Attributes command).

Set 777 to backup folder too.

Upload lilcms.php to folder cms. You can change its filename to whatever you like. You can change folder's name to whatever you like. It's completely ok if you access Lil' CMS through address such as www.somesite.com/cms9403KLC402/siteedit.php

You can also change location of text files if you like, just edit lilcms.php, it's right there in the second line:

$CPATH="../content/";

You may change word "content" to whatever you like.
We're almost there. Now go to locations of the web page(s) where you want editable text and insert the following piece of code:
If you renamed your web pages to SHTML:
If you renamed your web pages to PHP:
... and of course rename somefile.txt to introduction.txt or news.txt or whatever you came up with.
That'd be all! Now let's see how to use it.

Go to location of the cms, for example www.mysite.com/cms/lilcms.php
You'll get a window like this:
In the left column click on the file that you want to edit, then click on button Load. The file will open in the edit window on the right:
Before you edit a file it's wise to make a backup. Click on the button Backup and backup file will be created in the backup directory.
When you're done with editing, click on the button Update.

If you did something wrong, and if you backed up a file, click on the button Restore to revert the latest version.
That'd be all! :)

2 comments:

  1. I read this fantastic post about web pages to SHTML and also web pages to PHP. I really appreciate your valuable post because I need this topic with description.
    myob courses

    ReplyDelete
  2. You have pointed out some great points i like it nice blog
    thanks
    Offshore IT Staffing

    ReplyDelete