Forum Moderators: mack
I have currently been told that a website in frames is difficult for search engines to crawl. Is there any way to take what I have (ie. my menu frames) and put them into a straight html site so that my menu's are consistant through-out the whole site. Maybe a link I can put into to my code, I'm not sure. Some idea's would be greatly appreciated.
Chrissio
Do you happen to know what web server software your website is using? For example, Microsoft IIS, Apache, etc... If you can use ASP or PHP, that would have an affect on how you would set up your includes (and give you more options).
In your particular case, you will probably need to rename the page that has the include statements in it. For basic includes (in other words, includes not created with ASP or PHP) you need to use the ".shtml" file extension. so, home_page.html would become home_page.shtml. The web server will see the .shtml extension, and look for <!--#include virtual="navigation.html" -->, etc... Where ever the server finds a statement like this, it will replace it with the contents of "navigation.html".
Now if you use ASP or PHP, there are other ways to aproach this, but for now, try using the .shtml extension and see how it works....
[To Parent Directory]
6/13/2003 6:29 PM 2757 index.shtml
6/13/2003 6:23 PM 59250 logo.jpg
6/13/2003 6:29 PM 2166 sidemenu.html
6/13/2003 6:29 PM 3124 topmenu.html
And yes I can use ASP.
First, create a directory called "includes" (makes keeping track of things much easier).
In your includes directory, put your header, footer, ect.. You can name these files pretty much whatever your want. In fact, you can even put ASP scripts inside these, because include files get processed before the ASP script.
Next, in your ASP pages, you'll need to put the include statements where the code would normally go. For example, with a header, you might put something like this right after the <body> tag:
<!--#include virtual="/includes/header.asp"-->
Now here is where things could get a bit sticky, depending on the directory structure of your site.
Consider this example directory structure:
/root
---/index.asp
---/products
------/product1.asp
---/about
------/aboutme.asp
---/guides
------/bluewidgets
---------/page1.asp
------/redwidgets
---------/page3.asp
If all the pages were using the same header, a link to the home page from /guides/redwidgets/page3.asp would be <a href="../../index.asp">, while the same link from /products/product1.asp would be <a href="../index.asp">. Because of this, I like to use root-relative pathing. That way, the home page link in each of these examples would be <a href="/index.asp">. a link to the redwidgets pag3.asp file would be <a href="/guides/redwidgets/page3.asp">. This way, you links will work no matter what level in the directory structure you page is at. You'd use the same linking method for images, CSS files, Javascript files, etc...