Forum Moderators: mack

Message Too Old, No Replies

Web site in frames

         

chrissio

6:00 pm on Jun 12, 2003 (gmt 0)

10+ Year Member



Hi there,

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

korkus2000

6:03 pm on Jun 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your links should have a target attribute that targets the frames. If you remove this it will act like a normal site. I am not sure if this is what you are asking?

universalis

6:16 pm on Jun 12, 2003 (gmt 0)

10+ Year Member



It sounds as if you need SSI (server-side includes). Try a search here and you'll come up with loads of useful threads. This will enable you to have a consistent menu on each page, and you only have to change the one file to update the menu accross the whole site. It is much better for the search engines than using frames.

chrissio

4:46 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



Okay I have set up my separate menus. I think I use this code to link them <!--#include virtual="navigation.html" -->, if so where do I place this within the <head>?

korkus2000

5:00 pm on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You place them in the HTML where they would normally be on the page. I would not place them in the head unless it is JavaScript. If it is HTML like <a href=""> tags then it should be in the body where you would place it if it were the code itself.

chrissio

5:06 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



This doesn't seem to be working. Do I have the right extentions. Can they be html files linked to another html file? Sorry I am so confused!

griz_fan

6:26 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



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

chrissio

6:37 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



Okay it looks like I am on the right track. I'm trying to test it in a separate folder from my root though, does this matter. because when I try to view it I get this

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

griz_fan

9:35 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



Cool... ASP will help. So, assuming these are ASP pages, here's what I'd recomend.

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

chrissio

5:17 pm on Jun 16, 2003 (gmt 0)

10+ Year Member



Thanks so much everything is working like a charm now!