Friday, September 18, 2009

The transition from Static HTML to Dynamic Websites

I have started web development back in 2001. At that time, HTML was synonymous with website for me. Probably, it was the same for many web developers initially. However, I was slowly introduced to CSS and table-less design. It opened a plethora of options as to what all I can do with my pages with less effort and increase the flexibility of my website.

In 2006, I came across content management systems. Boom! It changed the way I developed websites thereafter. It is so easy to start a new simple website instantly with the help of a CMS. All that you have to do is download the CMS, upload it to your server, create a database, and install and configure it. That’s it; and, you will have a website ready to waiting for you to add content and customize. If you want a new look for your website, there are thousands of free templates available that you can download, install, and customize.

A total newbee can learn to do this in less than a day. However, I see that many people are still unaware of this technology and are still lingering in the world of static HTML pages. So, here is an introduction to how content management systems work and how to make the best use of them.

What is a content management system?
A content management system is a software application built in any language like PHP, .NET, JSP, etc. and allows users to install and start adding content and building a website. Generally, the content is added to a database such as MySQL instead of the files like HTML. So, all the content of the pages is stored in database and is retrieved on-the-fly when the page request is made in any browser. Here is a rough diagram of how the architecture is for a CMS based website.



The web browser sends requests to the web hosting server. The server then uses the appropriate compiler for the language. The database calls are made in that language and the final information is rendered back to the browser through the server.

How is it different from the static HTML web architecture? Well, in static HTML web architecture there is no need for database or compiler. The html pages are stored on the server and are called directly to render the information in the browser.

How is content added to the CMS?
Well, in HTML to add a new page, one has to create a new HTML file, add the content, format it according to the design of the site, upload the file to the server using FTP or Browser, and link it in the site appropriately.

When using a CMS, the basic design of the site is saved in the template files. All that one needs to do is to add the text and images through a text editor form on the website and save it. This content will be saved on the database with appropriate reference indexes in the database for call backs. So, you will be relieved from the stress of adding designing code, uploading through FTP, and linking in all pages.

Other advantages of using CMS include:
  1. Site wide changes are made easy. For example, if you wanted to change one link in the footer of the page and you have about 250 pages on your website. If it were classic HTML, then, you have to add that link in all the 250 pages and upload all of them to the server. If you have done this previously, then, you know how tedious and cumbersome this job is. In a CMS, the footer links are all stored in database and are rendered on the page dynamically. So, all that you have to do is to add it in one location and they will be automatically displayed on all the pages of the website.
  2. To me the most significant factor for choosing a CMS is that it is free.  There are so many good CMS out there on the internet that you do not need to pay for any code unless you are developing a highly customized and novel website.
  3. Another important advantage of using a CMS is that it is highly scalable. Most of the CMS that are available have a community of developers who are actively contributing more code, features, themes, and support to the software. My most favorite CMS is Drupal and it has a lovely community that offers support and constant updates to the software making my website up-to-date with latest technology and security features.
  4. Theme and design changes are easy. When you decide to bring a new look to your site which uses HTML pages, then, it is a big headache. However, when you want to change the look and feel of a CMS, it is easy because the themes are separately coded and changing few files will allow you to apply that theme across the site.
  5. Security is another issue. When you use these CMS, they have high security features since they have been tested and updated regularly. There are so many intelligent brains that are contributing to the development of such CMS.
  6. Finally, it makes sense to move ahead with latest technology even if it means a little learning curve.  You sure don’t want to be left alone in the race.

So, how much does a CMS cost?
Like I told above, there are many CMS which are available for free. Since I am a PHP developer, the ones I can think of off the top are Drupal, Joomla, and Wordpress. All of them have their own virtues and need to be selected depending on your requirements. All these software have active supporters and new versions are being released regularly. In the coming posts, I will discuss how to choose which CMS you need for your website. Till then… feedback and questions will be appreciated!