Guest_imported
New member
- Jan 1, 1970
- 0
Hi I'm kinda confused ,please read the following solution posted by Jason regarding the template in php
============================================================
Date: 12/15/00 16:44
By: Jason
Subject: My Solution
I am new at this but a simple solution is to use the same PHP
document over and over again but pass a variable which determines
which include document to use. This works very good for personal
home pages. Then you only create one template and plug in the
content you want for each page. Or if you want to redesign and use
the same content you have to only change one document.
For example:
Template PHP document
-------------------------
... HTML ...
<?
if (!$page) {
$page = "index.inc";
}
include("$page"
?>
... HTML ...
-------------------------
To call different documents you can simply form your href's as
follows.
: <a href="index.php?page=about.inc">
: About Me</a>
Allowing you to reuse the same layout with different content.
With this setup, each time the PHP document loads you can specify
a new include file, allowing you to only have one document with
many includes. The best part is, you can easily change content
without effecting layout, and can change layout without editing
every content page. Plus, if you include the style sheets in the
index.php you don't have to include formatting in the *.inc
because it will already be specified in the template. This may not
be the best solution for everybody but you would no longer need a
template because you would only need one layout page which would
basically be your template.
============================================================
I'm afraid I don't quite understand what'd he mean, could anyone please explain this in
details? But for sure that there are a number of portals using the same method like:
If possible, kindly please show me the source code of a simple web site which used the method
mentioned above. Thank you very much.
============================================================
Date: 12/15/00 16:44
By: Jason
Subject: My Solution
I am new at this but a simple solution is to use the same PHP
document over and over again but pass a variable which determines
which include document to use. This works very good for personal
home pages. Then you only create one template and plug in the
content you want for each page. Or if you want to redesign and use
the same content you have to only change one document.
For example:
Template PHP document
-------------------------
... HTML ...
<?
if (!$page) {
$page = "index.inc";
}
include("$page"
?>
... HTML ...
-------------------------
To call different documents you can simply form your href's as
follows.
: <a href="index.php?page=about.inc">
: About Me</a>
Allowing you to reuse the same layout with different content.
With this setup, each time the PHP document loads you can specify
a new include file, allowing you to only have one document with
many includes. The best part is, you can easily change content
without effecting layout, and can change layout without editing
every content page. Plus, if you include the style sheets in the
index.php you don't have to include formatting in the *.inc
because it will already be specified in the template. This may not
be the best solution for everybody but you would no longer need a
template because you would only need one layout page which would
basically be your template.
============================================================
I'm afraid I don't quite understand what'd he mean, could anyone please explain this in
details? But for sure that there are a number of portals using the same method like:
If possible, kindly please show me the source code of a simple web site which used the method
mentioned above. Thank you very much.