Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Using Incude statments for menu and head
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedUsing Incude statments for menu and head

 Post Reply Post Reply
Author
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Direct Link To This Post Topic: Using Incude statments for menu and head
    Posted: 10 November 2003 at 12:15pm

I am currently re designing my web site (Who isn't - it's a long grey winter ahead!)

I have decide to copy Bruce's method of including the header, menu (side bar) and footer. Have quickly written the following to test things:

<html>
<head>
</head>

<body>
<table border="0" cellpadding="4" cellspacing="4" style="border-collapse: collapse" width="100%" id="table1">
 <tr>
 <!-- #include file="header.inc" -->
 </tr>
 <tr>
  <td width="160"
  <!-- #include file="side_bar.inc" -->
  </td>
  <td align="left" valign="top">content </td>
 </tr>
 <tr>
  <!-- #include file="footer.inc" --></td>
 </tr>
</table>
</body>
</html>

 

If I use the above as a template for each content page, then I can just add the page text in the middle. Is this how most of you do it?

A small problem I forsee, is that as I divide most of the site into sub folders, how do I reference the inc files if the page is nested a few levels down - ideally, I do not want to have to alter the inlude file statements for each of these pages.

Thanks for any help or guidence you can offer.

Nathan, Corfu Greece

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Direct Link To This Post Posted: 10 November 2003 at 1:57pm
dont use virtual include. use absolute paths...
Back to Top
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Direct Link To This Post Posted: 10 November 2003 at 11:27pm

Thanks KC,

Tried this: <!-- #include file="http://www.agni-travel.com/corfu-travel-guide/header.i nc" -->

 

But it didn't work

I assume I need to give the path of the server which I think is:

www/corfu-travel-guide/header.inc

Having played with the system more, I realise of course that I also need to change the gif and pictures referenced in the included files - otherwise any pages nested into the site do not show the pics.

Nathan



Edited by Nathan
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Direct Link To This Post Posted: 11 November 2003 at 9:16am

using that path works for me...

http://www.agni-travel.com/corfu-travel-guide/header.inc

maybe you just needed to take out the space between the i and the n at the end of the link.



Edited by KCWebMonkey
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Direct Link To This Post Posted: 11 November 2003 at 9:20am

I use that basic structure. Another thing that I like to do is to use SSI for titles and meta tags. I find that it is nice to be able to control them from one central resource.

I also use a lot of x=request.querystring("x") and select case statements so that I can reuse code on a single page.  Lets me use one page with multiple includes conditionally, and I still get to template things pretty well.

e.g. I switch content in the include itself.

If things aren't working, check your code for typos. You had several above.

And you can't include with "http://". Use the absolute path on the server from the root. Serving content through http requires a lot more.

 

 

Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Direct Link To This Post Posted: 11 November 2003 at 11:01am

Use virtual includes:

<!--#include virtual="/includes/header.inc"-->

if the includes folder was a folder out of the root of your site, then no matter where this include is placed, or how deeply nested into folders it is, it will always look in the same location for the include file. The path is relative to the root of your site.

- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.
Back to Top
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Direct Link To This Post Posted: 15 November 2003 at 12:48am

Thanks everyone - that's exactly what I needed - works perfect now.

Nathan

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.