1 template file for a site with directories

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
griz
Forum Newbie
Posts: 5
Joined: Sat Jun 28, 2003 1:23 am

1 template file for a site with directories

Post by griz »

http://www.phpfreaks.com/tutorials/71/0.php

how do they get the footer, header, and menu attached to the each and every page. I know they are using the include function, but there must be something else. If they were just using the include they would have to make a separate template for 0.php, 1.php, 2.php, 3.php. Or maybe not.

So my question is, how do you get everpage to look the same through directories with using ONE TEMPLATE file.
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Post by Zeceer »

I believe the page you are refering to uses include, and have one seperate file for each part. header, right, left and footer.

I can't really see any other way of doing this, since the data have be included from somewhere.

+ by having a seperate ile for each part will also make the work of editing much easier.
MeltedPixel
Forum Newbie
Posts: 8
Joined: Sun Jun 29, 2003 12:22 am

Post by MeltedPixel »

Exactly, Zeceer.
It really comes in handy, and its really simple to use.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Please don't cross-post, you don't need multiple threads open on the same question:
viewtopic.php?t=10209

Mac
Locked