Forum Moderators: open

Message Too Old, No Replies

Including my menu on every page

Newbie question

         

DudeHelpMe

7:00 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



Question for the smart people:

I have been hand developing my site for about a year now. I am new to HTML development and now things are getting out of hand. When I want to update my menu or links that are contained on every page, I have to manually update every page...argh.

I know there is software out there, but does anyone know the best and easiest to use.

Please advise.

Dude

ogletree

7:19 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The best way to do this is use includes. What you should do is add

AddType application/x-httpd-php .html

to your .htaccess file. Then do a search and replace for all you files to remove each section like header and footer and replace with

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

Just put the file head.inc in the root of your site. If you are using subdirectories you may want to put the path before head.inc. Something like /usr/sitename/html/. Or whatever your host uses.

[edited by: ogletree at 7:36 pm (utc) on June 23, 2006]

kaled

7:27 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming you are using plain html then you'll need to either use SSI (server-side includes) or <iframe>s.

SSI must be enabled and that may require you to change filename extensions from .html to .shtml, also, you'll have to install server software (Apache) to test your site on your local machine.

<iframe> works well if you are certain you know the maximum size of the contents, however, the contents are usually indexed separately by search engines.

A third solution is to place all common code in templates so that editing the template causes all pages to be updated - however, you need a software package like Dreamweaver to do this. I prefer this solution myself.

Kaled.

DudeHelpMe

7:33 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



Thanks guys. I am looking for something a bit more basic. Essentially every page on my site is has the same header, footer and sides. the only part that differs is the content.

I have been looking at HTML editors like Coffeecup HTML Editor, but not sure if that has the template availability. Is software like dreamweaver the only useful tool.

thanks in advance.