Hello. I am designing my own relatively simple website, and have a very specific idea of how I want it to be navigated. I tried to explain it as well as possible in the second image. This is how I currently have it set up, using iframes. The page itself is index.html, which has on it 2 iframes. One displays an external file, menu.htm, which is just a table with all the site's main links on it. The other iframe's content changes. The main links display the other pages, and their target is the content iframe. This way, you never leave the index.htm page. You navigate by clicking the links in the menu iframe, which also never leaves your screen, since it is a part of the index page. The advantage of this, of course, is that if I want to change anything on the links menu bar, I need only change the menu.htm file, and the entire website will be affected. I can rather easily develop the rest of my site this way, and it should work fine. But the problem is, I've heard google doesn't handle iframes correctly at all. That and I've heard many negative things about iframes themselves. I think I understand why; since the content of my site is meant to be viewed within the index.htm page and therefore its iframes, if Google found a relevant term on one of the content pages and linked to it, that page would not be displayed within the iframe, ruining the site. Part of my question is, can anyone think of a way around this? I wonder if there is a way to force each individual page, like "page1.htm" and "page2.htm", to be displayed within the content iframe on the index page. I doubt it, but if such a thing could be done, it would save me a lot of time. The alternative I'm considering is using divs. I have little experience with these, but they seem simple enough. I imagine each content page would consist of a div on the top, which displays the "menu.htm" file, and the content below. This SHOULD save me the problem with Google: since each page is its own file with no iframes or frames, it should display correctly on its own. But the problem with this is, how do I display the menu file in a div? There is no <div src= "..."> or anything of that sort, as far as I can tell. Am I missing something obvious? Seems like it should be similar to the way my iframes work. Any help would be appreciated. Are there any easier ways to do this? I've seen the name Ajax thrown around a lot, but I'd honestly rather develop everything without downloading servers or anything like that. No SSI, PHP, STD, what have you. Thanks.
What you want to do is easy. The way you are doing it is creative, but not recommended. You said no to PHP, which is basically shooting yourself in the foot. No you cannot use DIVs to import external pages, therefore you're left with only Iframes or Canvas (HTML5.0). But canvas isn't meant to be used that way... so don't go there. If you were so bold as to use PHP, the only main difference in your files would be to change the .html ending to .php (index.php). Create a page called menus.php and write the HTML like normal <a href="">your menu item</a>, etc... In your other pages, simply write where you want the menu: <div class="menu"> <?php include("menu.php"); ?> </div> Now make your other pages like a normal web site: index.php, news.php, about.php, etc. Have them all call to the menu.php page, and you're done. If you insist on using IFrames, then once again, make a normal site (better for SEO) and only use an Iframe for the menu page. There is no need for two Iframes. Good luck
Ah, I'm so dumb! Why'd I even bother making a second iframe, this would fix the search engine problem easily! If I were to use PHP, do I have to install any external programs or local servers, like Apache? That is what I want to avoid doing, so iframes seemed the natural thing to do. Now I think I should be able to go ahead as I planned, simply by using one iframe.
The reality is that most servers (hosts) support PHP anyway. If you work on the server you can test everything there. Only if you want to test a local version do you need to set up a virtual server.