|
A Template Framework for Static Sites
Matthew Kendall
Templates can bring order and structure to a web site. In this article I
describe how templates can be used to control the page layout for a site
that is currently composed of many pages of static HTML, using a popular
template class and a new feature of PHP4.
But first, let's set the scene. There are two distinct motivations for
introducing templates:
- to separate functionality (PHP) from layout (HTML)
- to avoid duplication of repeated elements
Separating Functionality from Layout
The first motivation is the most-often discussed. Here the situation is that a
group of programmers produce PHP scripts to generate the content of a page,
whilst a group of graphic designers produce HTML and images to control the
appearance of the finished page. The idea is to allow both groups to work on
independent sets of files. The programmers can work on files that contain only
PHP, without concerning themselves with producing nicely presented HTML, whilst
the graphic designers can work on the layout of the page using their favourite
visual editor, without worrying about breaking any embedded code.
[ Next Page ]
| Comments: | ||
| Агентство недвижимости БАЗИС | Агентство недвижимости БАЗИС | 04/30/07 00:06 |
| john@hotmail.com | John Tyrrell | 03/08/05 14:12 |
| freaking BS, I enjoyed the IP | Freeflashonlinegames Com | 12/03/04 18:48 |
| it tells me i don't have | Freeflashonlinegames Com | 12/03/04 18:41 |
| Thanks. I hope other people test it too. | Sex Beplaced Ru | 12/03/04 18:19 |
| If not, what were all the witch trials about? | Sex Beplaced Ru | 12/03/04 18:12 |
| PLease, how Can i download. | Sex Beplaced Ru | 12/03/04 18:12 |
| freaking BS, I enjoyed the IP | Freeflashonlinegames Com | 12/03/04 18:12 |
| This was closely associated with the rebirth of | Sex Beplaced Ru | 12/03/04 18:09 |
| ummmmmmmmm whats this mummy?? | Freeflashonlinegames Com | 12/03/04 18:09 |
| it tells me i don't have | Sex Beplaced Ru | 12/03/04 17:57 |
| This was closely associated with the rebirth of | Freeflashonlinegames Com | 12/03/04 17:53 |
| Need help? | Zite | 01/29/04 09:50 |
| RE: FastClass Template Not For PHP 4.3.1 | Anas | 04/14/03 17:14 |
| FastClass Template Not For PHP 4.3.1 | Earthrise | 02/24/03 13:19 |
| HELP!!! I'm new.... | Dave | 12/13/02 19:02 |
| RE: The {} are not removed | Nico | 11/20/02 15:47 |
| FastTemplate | Chris | 10/22/02 14:48 |
| Linking with the template | Reaper | 08/22/02 11:13 |
| Chinese characters are corrupted. | Wendy Liu | 07/27/02 13:24 |
| Embedding PHP in templates | Nick | 07/17/02 00:29 |
| ZIP Please! | Dale | 06/29/02 06:37 |
| RE: is it possible...? | Nozmo | 05/21/02 15:27 |
| is it possible...? | Nozmo | 05/21/02 14:25 |
| RE: Using file.php?page=home | donoe | 04/12/02 13:36 |
| {$key} parsing | Ron Phillips | 03/18/02 11:34 |
| RE: php templates & parent directories | Eric C. Pollitt | 03/08/02 21:03 |
| RE: php templates & parent directories | Eric C. Pollitt | 03/05/02 16:41 |
| RE: My Solution | Anthony R. | 02/20/02 22:49 |
| RE: php templates & parent directories | rod | 02/13/02 21:01 |
| RE: Using file.php?page=home | Walter Horstman | 01/30/02 10:07 |
| frames check | aqua man | 01/02/02 17:34 |
| using template with pear | daniel | 01/02/02 01:35 |
| How to parse the "common elements" ? | Johan Svahn | 12/19/01 11:56 |
| Using file.php?page=home | Fleur Corfield | 12/19/01 11:34 |
| How to add a footer | John | 12/18/01 22:42 |
| RE: Passing variables from home to prepend | Samuel L. Diaz | 12/13/01 21:40 |
| RE: The {} are not removed | jerome bana | 10/03/01 19:31 |
| RE: how to add php script: HELP!!! | cgoodness | 08/28/01 07:01 |
| php templates & parent directories | Catie | 08/20/01 17:40 |
| template.php3 | Josef | 08/10/01 09:45 |
| does anyone still use this?? | jason matta | 07/23/01 23:52 |
| PHP and Frames | michael | 07/23/01 20:45 |
| Horrible Article! | Brandon Keim | 07/09/01 20:14 |
| Help on OB | Sherman Cahal | 06/13/01 21:24 |
| Modifications-4th Common Element | Earthrise | 05/18/01 18:03 |
| RE: Completely different way of using one fil | Alain Fontaine | 04/11/01 17:31 |
| Smarty template engine BETTER | syber | 04/06/01 17:56 |
| Smarty - the PHP compiling template engine | philip olson | 03/25/01 19:44 |
| RE: The {} are not removed | leslie | 03/14/01 22:53 |
| RE: Phplib's vs FastTemplate | basil | 03/11/01 21:29 |
| RE: Completely different way of using one fil | Chris Simmons | 02/16/01 02:31 |
| The {} are not removed | Bill Eddins | 02/14/01 10:18 |
| Completely different way of using one file | OkamiTsubasa | 02/11/01 17:49 |
| Admin. Tool and Content Publishing | Brian Flora | 01/19/01 20:34 |
| probs with cookies | wim | 01/13/01 08:28 |
| Slow?? | Peter | 01/04/01 10:17 |
| can it happen? | lin | 01/02/01 04:30 |
| RE: I'm confused as hell also | Chip | 01/02/01 01:50 |
| RE: I'm confused as hell also | jim | 12/30/00 02:32 |
| I'm confused as hell also | Chip | 12/25/00 01:18 |
| RE: class.FastTemplate.php | Matthew Kendall | 12/24/00 23:36 |
| RE: My Solution | Matthew Kendall | 12/24/00 23:23 |
| pixelcore | WeaponZero | 12/19/00 19:43 |
| My Solution | Jason | 12/15/00 16:44 |
| Confused as hell | iucpxleps | 12/10/00 07:56 |
| Embedding php in templates | jim | 12/10/00 07:29 |
| RE: how to add php script | jim | 12/09/00 03:46 |
| Use php to create templates for php | Daniel Staver | 12/07/00 12:49 |
| RE: Problems with warning | Andrey | 12/04/00 15:23 |
| how to add php script | Karl | 12/04/00 13:16 |
| Problems with warning | Frederic | 12/04/00 10:32 |
| Passing variables from home to prepend | Allen McLeod | 12/04/00 03:20 |
| RE: Phplib's vs FastTemplate | Andrey | 12/02/00 14:26 |
| New Window.... | James | 11/30/00 16:09 |
| RE: The big consideration | Scott Molinari | 11/28/00 15:52 |
| class.FastTemplate.php | Marceu Filho | 11/27/00 12:32 |
| The big consideration | Cliff Baeseman | 11/27/00 12:20 |
| RE: the zip archive | Kelly Jones | 11/26/00 15:02 |
| RE: Phplib's vs FastTemplate | Tom Anderson | 11/26/00 03:46 |
| the zip archive | Chip | 11/25/00 15:41 |
| RE: Easier ways to get the same effect | ashley etchell | 11/25/00 14:05 |
| Other Template Systems | Brian Snipes | 11/24/00 22:10 |
| take a look!! | Thanasis | 11/24/00 08:55 |
| RE: Phplib's vs FastTemplate | Damien Bonvillain | 11/24/00 05:33 |
| RE: Phplib's vs FastTemplate | Peter | 11/23/00 05:32 |
| RE: The template approach | jan janssen | 11/23/00 04:33 |
| RE: Is it only for "read-only" things ? | Paul K Egell-Johnsen | 11/23/00 04:01 |
| RE: The template approach | Paul K Egell-Johnsen | 11/23/00 04:00 |
| RE: The template approach | Liron Levy | 11/23/00 02:41 |
| RE: Phplib's vs FastTemplate | Benjamin Smith | 11/23/00 02:13 |
| Is it only for "read-only" things ? | Habibi | 11/23/00 00:53 |
| RE: The template approach | Jim Hawley | 11/22/00 15:44 |
| RE: The template approach | Anderson Fortaleza | 11/22/00 14:10 |
| RE: Phplib's vs FastTemplate | Jan Lehnardt | 11/22/00 12:45 |
| RE: The template approach | Paul K Egell-Johnsen | 11/22/00 11:19 |
| The template approach | Liron Levy | 11/22/00 10:50 |
| Phplib's vs FastTemplate | Alex Verstraeten | 11/22/00 10:41 |
| Easier ways to get the same effect | Auke van Slooten | 11/22/00 06:41 |
| auto-prepend/append | Andy Dickinson | 11/22/00 02:22 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


