en.opensuse.org

Structuring pages

Go to page 1 2 3 4 5 6 7 8

The first page has been taken apart. Depending on how you build your site, it can still be a daunting experience if you want to do changes in the start.inc or end.inc part, especially if you have added a lot of different code, like e.g. Java. In the beginning you had your paper. I hope you did not threw it away, because now we are going to use that again with breaking up the start.inc and end.inc into smaller blocks.

I look at start.inc an realize it is build up of several blocks. There is the header in HTML, the info part, the logo part and the menu. So I cut and paste these into respectivaly header.inc, info.inc, logo.inc and menu.inc. and replace it with an include. It could be that you also have some java blocks or something else, depending on your site. Now start.inc will look something like

<?php
include("header.inc");
include("info.inc");
include("logo.inc");
include("menu.inc");
?>

You cam do the same thing for end.inc. I then looked at menu.inc and realized there were 4 different blocks in that as well, so I cut and pasted that as well to each its own inc file. I asume you realize that anytime you want to include something into a page, you just can use the include from php. In each page this is possibe. You want a Java script include on your page and don't want to clutter up the code? Use include.

On the following page I will explain how to get titlebar different for each page and exlain the real great adantages of working like this.