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
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.