homepage Welcome to WebmasterWorld Guest from 54.167.185.110
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Getting iframed content to reconstitute with the framing page
Any way to do this?
Robert Charlton




msg:611177
 2:11 am on Oct 22, 2002 (gmt 0)

On another thread, papabaer and mdharrold have provided some excellent tips for using iframe content effectively as doorway content to a site.

[webmasterworld.com...]

I'm going to be working on a site that I'm guessing... from initial discussions... will be using iframes in a very graphic (and potentially search engine unfriendly) way, to frame what is really the core content of the site, and I'm trying to figure out how to make the setup work for search too. SEO is a reluctant afterthought on this site... so I can't make waves.

The site will be using a drop-down list (probably javascript or CGI) to cause content pages to display in an iframe on the home page. The content will be text that I'd like to get indexed on the engines.

Providing spiderable links to the content pages can probably be handled on some sort of site-map page, perhaps identified as "check out these links if you have an old crappy browser made by Netscape."

The dilemma is that I'm almost certain that the site designers want to make the iframe more or less invisible, as that's graphically elegant, which means that there would be no navigation on the framed content pages. So if these pages were returned by the engines, they'd be useless in getting back to the main site... much like framed content without navigation on a regular frame.

The framesets for regular frames, though, can be reconstituted with javascript. Any thought on ways to do this with iframes, which I think would make this situation workable?

There might be a Netscape issue too with the reconstituted pages....

 

Purple Martin




msg:611178
 2:26 am on Oct 22, 2002 (gmt 0)

So is the main issue that there's no link from a content page back to the main (container) page?

What's to stop you putting such a link in? You might be able to use the same iframe-N4-freindly-link technique to hide the link from modern browsers but allow bots to see it: try putting an iframe with no src on a content page, and within the iframe tags put a link to the main page. I'd imagine that the iframe-friendly browsers will show nothing there, while N4 and bots will see and be able to follow the link.

mdharrold




msg:611179
 2:37 am on Oct 22, 2002 (gmt 0)

Pull the pages in from a database and have a check in place to see if the referer is from your own domain. If not, add navigation, if so, don't add navigation.

I suppose, you could also have the script attempt to redirect the user if they are not referred from your domain to the full page that displays the framed content. That would be really slick.

Robert Charlton




msg:611180
 5:12 am on Oct 22, 2002 (gmt 0)

So is the main issue that there's no link from a content page back to the main (container) page?

What's to stop you putting such a link in?

Purple Martin - I'm not sure I'm following you, but I'm not an expert in iframes. If an engine returned the iframed content page, the issue would be that people wouldn't see the branding and navigation information which would be on the framing page.

I don't understand what providing a link for the bots back to the framing page would accomplish. You're probably stating it very clearly... I'm just not familiar enough with the subtleties of iframes.

I suppose, you could also have the script attempt to redirect the user if they are not referred from your domain to the full page that displays the framed content. That would be really slick.

mdharrold - Yes, it would be slick... that's what I was hoping someone had figured out how to do. I'm neither experienced in iframes or javascript, so this is way beyond me.

The database implementation is intriguing, but I'm guessing it will be a static site.

I came across this page [xs4all.nl] about iframes and javascript while searching on Google, which appears to be a helpful reference on what happens with javascript functions and iframes in various browsers.

mdharrold




msg:611181
 5:28 am on Oct 22, 2002 (gmt 0)

mdharrold - Yes, it would be slick... that's what I was hoping someone had figured out how to do. I'm neither experienced in iframes or javascript, so this is way beyond me.

I would personally avoid javascript. If the user is using a browser that doesn't support iframes, chances are they don't support javascript.

The database implementation is intriguing, but I'm guessing it will be a static site.

There is no reason why the site can't be static and still implement this tactic. Simply hard code the page content into the scrpt.
PERL example:

if ($ENV{REQUEST_URI} eq "/fakepage.html")
{print "<p>Fake page content</p>");}
elsif ($ENV{REQUEST_URI} eq "/evenfakerpage.html")
{print "<p>Even faker page content</p>";}

Robert Charlton




msg:611182
 6:08 am on Oct 22, 2002 (gmt 0)

I would personally avoid javascript. If the user is using a browser that doesn't support iframes, chances are they don't support javascript.

I also dislike relying on javascript for any essential site function. I would assume, though, that if the site designers are setting this up in iframes, they're assuming the use of browsers that support iframes... and that since they're using pull-down menus (whether javascript or Perl), they're also assuming that active scripting will be enabled (in the IE security options). I don't know this for sure because this hasn't been discussed yet.

There is no reason why the site can't be static and still implement this tactic. Simply hard code the page content into the scrpt.
PERL example:

Thanks. I'm embarrassed to ask on what page the script would appear. I assume it's on fakepage.html, one of the target pages.

mdharrold




msg:611183
 6:25 am on Oct 22, 2002 (gmt 0)

Don't be embarrassed, to implement what I suggested, create a perl script that will handle all of the iframe content. Then link the iframe's src to the script. I personally like to use the QUERY_STRING for such things, so this example will use that.

#!/usr/bin/perl

print "Content-type: text/html\n\n";

$domain = "http://yourdomain.com";
$navigation = "<p><a href=\"$domain\">Home Page</a>
<br /><a href=\"$domain/page2.html\">page 2</a>
<br /><a href=\"$domain/page3.html\">page 3</a></p><!-- you get the idea -->";

if ($ENV{HTTP_REFERER} !~ /$domain/i)
{print "$navigation";}

if ($ENV{QUERY_STRING} eq "home")
{print "<p>Home page text</p>";}
elsif ($ENV{QUERY_STRING} eq "page2")
{print "<p>Page 2 text. Remember to escape your \"quotes\".</p>";}
elsif ($ENV{QUERY_STRING} eq "page3")
{print "<p>Then call each iframe. src would equal \"script_name.cgi?page3\"</p>";}

exit(0);

Perhaps someone will come along with something you better understand.
I'd be happy to write the real script for you if needed.

tedster




msg:611184
 4:06 pm on Oct 22, 2002 (gmt 0)

A Javascript solution would be similar to reconstituting a regular framed page [webmasterworld.com]:

1. Test to see if the page is orphaned
2. If so, redirect to a second, "skeleton" version of the full page
3. Pass the URL for the iframe's content as a query string variable
4. Write that variable into the new page as the iframe target

Robert Charlton




msg:611185
 5:52 am on Oct 23, 2002 (gmt 0)

Thanks for all the good input...

One point I've re-thought... for the "site-map" page (with local links to the framed content for spiders)... if that page tells the user, "if your browser doesn't support iframes, browse here"... if you're still concerned about level 3 or earlier browsers, this probably should be Perl, not javascript... otherwise those users are likely to be disappointed. If it's Netscape 4, though, which is where I think the user issue would be... isn't javascript supported even though iframes are not?

For reconstituting search engine-returned pages, tedster's javascript approach sounds intriguing. Has anybody done it?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved