sidebar magic

I learnt how to do php include today. I created a new index template to hold the code for the sidebar so I don’t have to change it on every template.

Think of the includes as building blocks for the website. An include is just a text file that has whatever I want in that block. I have different includes for the main sidebar, section sidebars, admin, buttons and menu bar. The sitewide includes are all in one folder.

For instance where I want to put the main sidebar I put:

<?
include “/home/invisibl/www/www/includes/sidebarmain.inc”;
?>

And it shows the rotating image, about links and the main page links.

The biggest advantage is if something changes all I need to do is change one file rather than every page that it appears on.

I’m getting a real kick outta this.