I have a website that uses iframes to display content. If the URL to a content is called directly by the user it should be "jailed" into the main page.
The main page provides a header and a footer as well as the navigation menu. There is one iframe named contentframe. All links in the navigation (and footer and stuff) target this frame.
My Solution for "jailing"
var jailed = (window.self != window.top); where jailed will be true if the page is "jailed" already.
This way the main page is loaded within the iframe.
This way I can directly link to a content and after only one reload everything will be displayed just fine. But I have questions regarding some issues.
Are there seo problems?
I found out, that it's hard to find some info material for this topic.
What about best practices?
I know how to do what I want to do technically, but how about best practices? I couldn't find anything so far, but maybe some of you had to deal with that. Or is my solution perfectly fine?
I know iframes are not a very elegant way for displaying the content (from the same domain), but I'm stuck with it and I must deal with it, so please no "do not use iframes comments" :-)
Please, no opinions. I'm quite sure there are some facts on how to do this the best way.
The following link describes that the intent is very important. In a way I'm showing different content to GoogleBot than to my user, technically. But the content really stays the same only it is decorated a bit. But what does GoogleBot say? Cloaking and/or Sneaky Redirects