Sunday, December 22, 2024

Easy Content Management with Server Side Includes

Share

Content Management systems are an invaluable backend aspect of a webpage now-days.

I honestly see very few websites that can really say they don’t need some sort of Content Management system.

However, not all content management needs are the same. There are plenty of instances where all that needs to be altered is slight text here and there, or details. It doesn’t make sense for the company to pay a designer an hourly fee every time they need an update, and it doesn’t help you to have to spend half your day working on pointless copy updates.

Here in lies the problem, most content management systems are not designed for small alterations. They are either custom modified code, where customers end up paying for development of features they are not even going to use (ie: the more complex functions they don’t need), or you end up paying for an off the shelf package that takes more time and effort to setup and still has more than you ever needed.

What I do to solve this problem is simply use server side includes. Server side includes are basically a line of code in a webpage that says “load this part of the website from this file.” This makes it extremely easy to update a section of the website that is just a body of text.

So as you are developing the website, sit down with your clients and ask them which paragraphs they want to be able to edit. This could be news, about us, past projects, etc.

Once you have found that out, store the text of each of those paragraphs into a .txt file in a “cms” or similar folder. You can then apply the proper markup around the server side include, and style it properly. For example,

Hello.txt in /public_html/cms

Hello, and welcome to our site!

Then in the index.html

<h1> <!--#include virtual="/cms/hello.txt"--> </h1>

Now all that has to be done to edit the heading, is setting up an FTP account that drops them in the CMS folder, and they can upload the file as needed with the changes.

The drawbacks at this point are that they still have to deal with the hassle of FTP. Don’t worry though, in part two I will describe how to make a simple CGI script to deal with that for you like I have done for clients such as Ann Arbor’s Hideaway Lane and Kingsley Lane Lofts.

The other drawback is server side includes also do put an increased load on your website, so it will download slightly slower.

The less server side includes on your page, the quicker it will download, and you can try and compensate for the increase in load by using proper code to reduce file size, and proper image optimization.

Stay tuned for parts 2 and 3!

Add to document.write(“Del.icio.us”) | Digg | Yahoo! My Web

Technorati:

Ross Johnson is co-founder of Ann Arbor Web Design Company, 3.7 Designs. He has been coding with perl and php for five years and counting, and looks to make the most cost effective and successful websites that he can for his clients.

Table of contents

Read more

Local News