Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Follow-up: Simple Template

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Thanks to ristmo2001 though.Well, I'm totally confused now. Could you please take a look at ? They used the method like this:


So I'm supposed that they have the module.php, which acts more like a template file and performs the necessary routine to construct the framework of the whole site using the variable passed. Again if my site consists of header, menu on the left,sections on the right and a footer on the bottom something like this:

--------------------------------------------------------------------------------------
header
--------------------------------------------------------------------------------------
|
|
|
|
menu | sections(gusetbook,download,forum..go here)
|
|
|
----------------------------------------------------------------------------------------
footer
---------------------------------------------------------------------------------------
how do I approach yours without affecting the static elements like menu,header and footer?
Possible to provide simple source code as well?Thanks.......

Cheers!!!
 
To do it like that, do this:
<?
switch($ba){
case &quot;forum&quot;;
?><table><tr><td colspan=&quot;2&quot;><?
include(&quot;header.php&quot;);
?></td></tr><tr><td><?
include(&quot;menu.php&quot;);
?></td><td><?
include(&quot;forum.php&quot;);
?></td></tr><tr><td colspan=&quot;2&quot;><?
include(&quot;footer.php&quot;);
?></td></tr></table><?
break;

case &quot;guest_book&quot;;
?><table><tr><td colspan=&quot;2&quot;><?
include(&quot;header.php&quot;);
?></td></tr><tr><td><?
include(&quot;menu.php&quot;);
?></td><td><?
include(&quot;guest_book.php&quot;);
?></td></tr><tr><td colspan=&quot;2&quot;><?
include(&quot;footer.php&quot;);
?></td></tr></table><?
break;

}
?>

I used switch($ba) instead of switch($name). You can use any name you want and it doesn't matter. This is just one name that's becomming popular. Also, I usually name my &quot;template page&quot; index.php. That site uses modules.php. Once again, the names don't matter as long as you link with the same names you used. to link to the forums page, you'd do this:
index.php?ba=forum
You'd make a link to the guestbook page like this:
index.php?ba=guest_book

Hopefully I made it clearer this time.


Rick If I have helped you just click the first link below to let me know :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top