Template Script

Source Code



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html lang="en">
<head>
  <title>Template :  <?php echo 'Page: '  . $_GET[page]; ?></title>
  <meta name="expires" content="0" >
  <style type="text/css" media="screen">
@import "./fixed4all.css";
  </style>
       <!--[if IE]> <link  href="./fixed4ie.css"  rel="stylesheet"  type="text/css"  media="screen">
<script type="text/javascript">onload = function() { content.focus() }</script><![endif]-->
</head>
   <body>
<div id="content"><hr>                
<?php
     include("content_handler.php");
?>
<hr> </div>
<div id="footer">~~  <a href="#">Web Master</a>  ~~</div>
<div id="header"><h1>PHP/Flat-file Web Site Template</h1></div>
<div id="sidebar">   
<?php include ("menu_script.php") ?> </div>
</body>
</html>


How It Works

Starts off with the HTML header information.
This example is minimal. You will probably want to
add to the list of meta tags, for instance

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html lang="en">
<head>
  <title>Template :  <?php echo 'Page: '  . $_GET[page]; ?></title>
  <meta name="expires" content="0" >
  

The style sheets are linked or imported as you see fit.
This example includes an IE Conditional Clause to select a
different Stylesheet for IE Browsers.

  <style type="text/css" media="screen">
@import "./fixed4all.css";
  </style>
       <!--[if IE]> <link  href="./fixed4ie.css"  
	 rel="stylesheet"  type="text/css"  media="screen">
<script type="text/javascript">onload = function() 
{ content.focus() }</script><![endif]-->
</head>
  

As the page begins, a script is called which determines which page
is to be displayed in the Browser.
For details of the content_handler script, see Page Two.

   <body>
<div id="content"><hr>                
<?php
		include("content_handler.php");
?>
<hr> </div>

The next two div's add the Footer and Header.
In the original Template, these elements of the html are positioned
absolutely, so they can be here, but if you are using a layout
which depends on the relative position of these items,
simply move the div's to the appropriate position in the Template.

Basicly, the parts of this Template can and should be
re-arranged to suit the particular layout for your page.
A good method is to begin with a skeleton of the page layout
you wish to acheive and drop the scripts into the appropriate div's,
according to the page look you are trying to achieve.

<div id="footer">~~  <a href="#">Web Master</a>  ~~</div>
<div id="header"><h1>PHP/Flat-file Web Site Template</h1></div>  

The sidebar script is called from here.
There is another page detailing the script and the data
souce is discussed on Page Four.
Again, re-arrange the components in this template to suit the
Page Layout you are trying to acheive.
The actual template can be altered by re-positioning the div's
containing the components and also with the handling
of the div's by the css files used.
This Template Model uses two css file.
One is used for structure and colors for non-IE Browsers
and another one for structure for IE Browsers in order to acheive
the "Framed without Frames" look.
If the page you design does not require these features, simply replace
the references to those files, re-arrange the div's in this template
to reflect your design, and link or @Import new css files. Easy.

<div id="sidebar">
<?php include ("menu_script.php") ?> </div>
</body>
</html>

Previous page: The Template Index PageNext page: The Sidebar Menu Script