Jump to content

Dynamic website templates


Derby Artists

Recommended Posts

Hi

Just wanted an idea of what other people do.....

I am building a dynamic site and going down the template route where you call the header and footer etc from index.php

ie

<?php include("header.php");

<?php include("footer.php");

 

The question is how much do you people break this down.

The site I am building has the top navigation, which is a horizontal drop down, with a hell of a lot of links on.

Below this is a flash video, and below this is a quick search with two dropdown lists, one for all the counties in the uk the other for the speciality in that given area.

 

So would you keep the top nav, flash video and quick search all in the header or would you break it down a little and have top nav in one php file and quicksearch in another and so on and so on. And call them all together in the header page.

 

Thanks for your help

 

 

Link to comment
https://forums.phpfreaks.com/topic/178840-dynamic-website-templates/
Share on other sites

Speaking for myself I would include anything thats on all pages and at the top of the page before other content in the header.php file. Including but not being limited to the <head> section of the HTML, a banner image, site navigation, seach bar.

Cheers, could I ask, in the header and footer php pages do you strip out this:-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

 

Is there any problems with leaving this in or taking it out

Ignore the fact that header.php and footer.php are seperate files. Anything you would normally have in your page should still be there, it just get moved to whichever files its most appropriate in. As far as the server is concerned it will look like this..

 

header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<img src="images/header.jpg" />
<ul>
<li>Home</li>
<li>Other Page</li>
<li>Something</li>
<li>Contact</li>
</ul>

 

footer.php

<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</body>

 

index.php

<?php include 'header.php'; ?>
<!-- whatever page content is -->
<?php include 'footer.php'; ?>

 

Is for all intents and purposes exactly the same as just having...

 

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<img src="images/header.jpg" />
<ul>
<li>Home</li>
<li>Other Page</li>
<li>Something</li>
<li>Contact</li>
</ul>
<!-- whatever page content is -->
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</body>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.