|
|
HTML Code TutorialTutor Ebook Download Frames and Search EnginesThe decision of whether or not to use frames when building a website has been a matter of debate for many years. In the past, search engines had problems indexing web pages that used a frames structure. Not Today!! You will need a basic understanding of frames and how they work before you venture on the course of action proposed in this document.
Code for frameset - index.html: The documents that appear in frame windows A,B and C are just plain ole HTML pages. The problem is not getting them indexed on a search engine, but what happens if they are indexed and someone accesses the page by clicking the link. What if the heading page was indexed and a surfer accessed the page. All that he would see is the heading of our document. What if the links page was indexed and a searcher accessed it. All he would see is a list of links. The same question arises for every source page that will exist on our website. One solution would be to place a hyperlink on each page with the caption Restore Frames. The hyperlink would be used to send the surfer to the main frameset page. A more complete solution would be to redirect our surfer to a frameset specially designed to properly display the document. This can be done with the simple addition of a block of Javascript. Of course this only works with web browsers that have Javascript capability enabled. Most do, but we'll add an extra step later for those that don't. The TaskOur task is going to be to create several different frameset pages, with the same structure as our main frameset page. The Main Frameset PageOur main frameset page will be our index.html page which will display when our URL is accessed. It will contain more information than our other frameset pages. We want it to be indexed so we must provide information for the search engines. Our main frameset page will be our index.html page which will display when our URL is accessed. It will contain more information than our other frameset pages. We want it to be indexed so we must provide information for the search engines. |
Contents Table of ContentsIntroduction Page Structure Basic HTML PageDoctype The Body Tag The Header Tag The Division Tag Horizontal Rule Anchor Tag Anchor Tag - Intradocument Anchor Tag - Image Using Borders The ID Attribute Meta Tags Text Controls Style SheetsWorking With Fonts The Paragraph Tag Paragraphs-Images Using Lists The Pre Tag Line Break Tag Tables Basics of TablesColspan Forms Form BasicsCheck Boxes Text Boxes Selection Boxes Frames Basic FramesTarget and Scrolling Search Engines Miscellaneous Buttons with CSSUsing Color Color Chart Using Images Using Templates Uploading HTML pages. HTML-CSS Quizzes |
|
To place the information for indexing purposes on the page we'll use the noframes tag. The code: Redirecting to the Main Frameset (index.html)In our example there are only 3 pages we want to redirect to index.html. They will be the links page, the heading page and mostly likely the home page which we specify as the default page for frame window C. The Javascript<SCRIPT TYPE="text/javascript">This code is placed between the head section and the body section of the links, heading and home page. When either of the pages is directly accessed it will redirect to index.html with all pages in their respective windows. Now for browsers that don't have Javascript enabled (and they are few) , place a footer on the page containing a hyperlink that points to index.html. Additional FramesetsNow suppose our links page contains a link to target a source page named aboutus.html into frame window C. We could just place the same redirection code on the page and send it to index.html. But the surfer would then have to find his way to the page he had originally clicked on. A more efficient means would be to create a second frameset page where the default URL for frame window C is aboutus.html. So we create a new page with the identical frame structure of index.html (exclude the noframes section), and name it frameset_2.html. The only difference in structure is that the default source page for frame c is aboutus.html. Code modified for frameset_2.html: The Javascript for aboutus.html<SCRIPT TYPE="text/javascript">Once again we'll also add a hyperlink to the aboutus.html page that sends the non Java browser to frameset_2.html Create a separate frameset page for each additional HTML page that you think might have a chance of being indexed by a search engine. Naming Web Pages and Frameset PagesDon't name your pages like we did for our demo. Use keyword phrases in your page names. For example, we probably should have named our main content page, frames-redirection.html and the matching frameset page something like frames-redirection-rd.html for better results on Google. Does It Work?To find out, go to search.msn.com and search.yahoo.com. Search the phrase frames and redirection. Our little demo website has a #1 ranking on both SEs. Use quotes on Ask and Google and it's still on the first page of results. Check out our Free Frames Template Kit or try our Free Frames Kit Demo |
|
|
|
CGI Online |