Easier Website Format Editing

SitePoint Members,

How can I create a 3 column website of more than one webpage where when I change things in the far left and far right columns the changes will occur in all of the pages. The center column would contain text, different subjects from web page to webpage.

I know there’s wordpress, but it’s not all that great. They keep having urgent updates due to all the spam it attracts and due to the many features they keep adding that everyone has to carry the weight for - whether they use them or not.

Thanks,

Chris

You have two options.

The first is the use of an IFrame, which is really not advisable, though it’s the simplest way of doing what you want to do.

The other is a server-side application - e.g. PHP (Bias on my part due to popularity and preference). If all you want is what you’ve mentioned above, you won’t need to use anything as bulky as wordpress. A simple version would be the following.

Have two files, say Left.php and Right.php. The extension being PHP merely means that they can contain PHP code if you so choose, but it’s fine to use plain HTML inside them. If you haven’t come across PHP yet, you will need to look up some basic tutorials if you want more features - and you will need hosting which allows for PHP.

Anyway, so you have these two files. In one, put what you want to be in the left. As long as you don’t open a <?php tag (on some servers all that’s necessary is <?, though the general consensus in the PHP community is to avoid this, for various reasons) then it will just output the HTML you put into the files.

In all the other files, where you want the left column, simply put the following:

<?php
include('Left.php');
?>

And for the right:

<?php
include('Right.php');
?>

You will want these files, the content files, to be parsed as PHP. The simple way is to have their extension as .php - but if they already exist as .html, check out this article which seems to explain in good detail what you need to do.

And voila. Changing left.php will change the left section of every page.

If you want to go one step further, you can have a file called top.php and a file called bottom.php, and include the main HTML layout of every page in it. Then include top.php instead of putting all of the HTML at the top of every file. This allows you to change the design of every page instantaneously. You can include left.php inside top.php to save you doing this in the other pages.

The downside to this is that changing individual design elements for certain pages would be more difficult, but for many people this isn’t an issue.

The step even further than this is to use an open-source CMS (content management system). There are THOUSANDS of them out there, so try a few out and you may find something you like. Wordpress itself is a CMS but there are many others out there without bulky features. Your requirements seem simple, so I’d recommend you try this out if you want simpler methods of updating your website.

If you want more control, take some time aside to learn PHP! I’d highly recommend it, even if you just learn the basics.

Jake,

That’s a lot of good info. Thanks for taking the time. I’m gonna have to learn php. Do you know of a good php site for beginners ?

Thanks,

Chris

There are quite a few!

PHP: PHP Manual - Manual
PHP Tutorial - Introduction
PHP 101 (part 1): Down the Rabbit Hole
Beginners PHP Tutorials

Jake,
PHP fans are really spreading the word - of PHP.

Thanks,

Chris