Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    I have heard that frames are pretty much a no-go when it comes to search engine compatability. Having not used frames before, i was intreagued, and wanted to find out for myself, so i have built frames on one page of a site.
    The content of these frames is quite verbose (as one would expect) and therefore forms quite a large part of the site content, so i dont wish to block them from the bots totally.
    Now, i see what the problem is with frames - a seach engine can find the html frame content, and will link to it, but the navigation to other pages in the site is lost.

    Just thinking aloud here, and wondering wether a combination of building a sitemap (to tell the search engines that the html frame content is present) AND restricting any ranking of it by using 'robots.txt' ; would thus prevent any backdoor entry to the site?

    It is possible that it would drop a sites' search ranking if the frame content was blocked by robots.txt.

    Otherwise, i guess another solution would be to just add a link to the rest of the site from within the html frame content.

    Any other suggestions?

    Thanks
    James
    •  
      CommentAuthorkay
    • CommentTimeAug 11th 2007
     
    The "old school" solution was to allow the spiders to go wherever they wished through the frames, then force "real users" coming to an internal frame to the top level frame using javascript. A nightmare to maintain and with an obvious accessibility problem for user agents without javascript.

    The reason I don't consider frames anymore is that they bring serious usability problems as well - users cannot bookmark pages and the non-changing address bar gives no navigational clues.
    •  
      CommentAuthornsavalas
    • CommentTimeAug 19th 2007 edited
     
    Dear James Eden,

    I do not use frames anymore (except in extreme cases of personal laziness) because of the order a server will deliver the content. In a framed situation, the framed page, and it's content, is rendered last; that is usually what I want to avoid. Think about that before you follow my advice and implement the code I offer you, below.

    Here is a standards-compliant, search engine friendly, and never 'outside of navigation' solution. When a search engine 'spiders' your framed page, and a visitor clicks the link, it is returned (read rendered) inside it's navigation page. However, I warn you: even though this solution solves your problem perfectly, it has a selfish, needy side, too. You'll see why when you test it.

    OK. Let's assume you have a page called portfolio.htm - it is a vertically split, left side nav bar (links, name="nav": 150px wide)/right side content (changing frame, name="main": 100% wide) design, like this:

    <html>
    <head>
    <title>Portfolio</title>
    </head>
    <frameset cols="150,*">
    <frame name="nav" target="main" src="nav.htm">
    <frame name="main" src="frame1.htm">
    </frameset>
    </html>

    Every time someone requests frame1.htm from outside your site, they'll get it outside of portfolio.htm, and therefore lacking navigation, right? Sure, and that's how the search engines will offer links to your site in their results. Bad news for James.

    Here is the solution: call the framed page via javascript. Do not use frameset; that trick never works. Instead, for sanity and order's sake, let's save all of the frame pages for portfolio.htm in a sub-folder named portfolio. Then, write the code for portfolio.htm, our 'nav & frame' page, like this:

    <html>
    <head>
    <title>portfolio</title>
    </head>
    <body>
    <table style="width: 100%; height: 100%">
    <tr>
    <td style="width: 150px; height: 100%">
    navigation:
    <ul>
    <li><a href="portfolio/frame1.htm">frame 1</a></li>
    <li><a href="portfolio/frame2.htm">frame 2</a></li>
    <li><a href="portfolio/frame3.htm">frame 3</a></li>
    <li><a href="portfolio/frame4.htm">frame 4</a></li>
    </ul>
    </td>
    <td>
    <script type="text/javascript">
    /* <![CDATA[ */
    var curl = location.search.substring(1) ? unescape(location.search.substring(1)) : 'portfolio/frame1.htm';
    document.writeln('<iframe src="'+curl+'" width="100%" height="100%" >');
    /* ]]> */
    </script>
    </td>
    </tr>
    </table>
    </body>
    </html>

    (note the line:
    (location.search.substring(1)) : 'portfolio/frame1.htm'
    it specifies the first framed page - frame1.htm - to show)

    Now, create the frame pages (I called them frame1.htm, frame2.htm, etc.) in the sub-folder portfolio, and to each one, in it's <head> section, add:

    <script type="text/javascript">
    if (self.location == top.location &&
    location.search.substring(1) != 'nf')
    top.location.href = 'http://you.com/portfolio.htm?' + escape(self.location);
    </script>

    Now browse to http://you.com/portfolio/frame1.htm in any browser. Hooray for you, James! It works!

    As you see in the portfolio.htm code, I do not declare a link 'target', as I did in the frameset example (target="main"). There is no need to do that anymore. The page frame1.htm, if requested alone, will come out as:

    http://you.com/portfolio.htm?http://you.com/portfolio/frame1.htm

    within it's navigational holding page, every time. The main page: portfolio.htm, when requested alone, will include frame1.htm as it's initial content.

    Good luck and best wishes. I'd like to see your finished design - send me a link. Oh, and remember: I warned you. This script has a peculiar personality flaw that will drive you nuts. I leave it to you to discover it. I hope to hear from you soon. Until I do, James, I remain,

    Sincerely,
    Nicholas Savalas - http://savalas.tv - nick@savalas.tv
  2.  
    One solution (without using frames) would be to embed the content in the page and then use js/ajax to call out to the class name of div objects. You can use the css property "display:none" top hide content that is not being viewed (although Google doesn't like this). Then when someone clicks on the link you use a javascript to change the name of the div class from "hidden" to "show" where show doesn't have the "display:none" property. The hidden content should then show up.

    The ajax method is to make the text a string/document in php and use javascript to get the php, that way you can replace the same content dynamically (without reloading the page). There is an example of how to dynamically include the content of another document in the current document using ajax here.

    ________________
    Posted by Demonz Media web design Sydney
  3.  
    Search engines are blind to Frames. However you can add a sitemap on your website which should be accessible from your homepage.

    This sitemap should contain all your important pages. This will allow Google / Yahoo to crawl content from your website. Otherwise it would be too difficult for search engines to crawl your website.
    ________________
    SEO India : BSOLUTIONS