|
|
#1 (permalink) |
|
Surpass Fan
Seasoned Poster
Joined in Sep 2003
Lives in Atlanta
Hosted on Pass67
49 posts
Gave thanks: 0
Thanked 0 times
|
Frame enforcer for iframes
First I wish there was a "General" forum on coding because I'm not sure where to start with this. Anyway here's the problem.
I built a pretty nice site for a client using iframes in order to keep the static elements such as the navigation menu and the footer from having to reload when moving from page to page. It's all working very well when suddenly the client decides to use Google's paid referral service. Google requires direct links to the pages he wants to promote. These direct URLs currently are really just "simple-content" html files that normally load into one or more iframes. When opened directly, the visitor bypasses the main index page and gets the "content" frame without the rest of the supporting layout. So there's no menu, no footer and, (since the content htmls are transparent), no background. I have a "frame-enforcer" script that will redirect anybody trying to access the page directly to the index page, but from there they would have to click the menu button to get to desired page. This is not acceptable to Google. They require the link supplied to them to open the page being targeted. This site operates so much more efficiently the way it's designed now. How can I give Google what they want without having to build special html only pages just for them? Is there a "two-stage" redirect script out there somewhere that will load the index first and then the targeted iframe! Here is a link to the site in case you need to see what I'm talking about: A Blast Entertainment Network Here is what happens if you use one of the direct links that Google wants: Direct link to band page Thanks for any help or advice. Jim B. |
|
|
|
|
|
#2 (permalink) |
|
Surpass Fan
Super #1
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
|
Just an idea, but couldn't you use a PHP include() for all the static elements, and make header() or two or five that specify that it should be cached for, say, an hour. Wouldn't that load the static graphics and such much faster? No idea if this would work; I just thought of it off the top of my head.
__________________
- Evan Charlton | [site] | Server - SH58 |
|
|
|
|
|
#3 (permalink) |
|
Uniquely Me
Super #1
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
|
Your other option is use links such as
http://www.mydomain.com/index.php?x=pageone whereas x=pageone will load a specific page into the said iframe. For me, I just don't pay google, so I don't have this problem. I don't know how well this would work as I've never had to try it before, could be worth a shot. kickersny - you wouldn't happen to have/know where I can get the script you're talking about would you? the one that caches stuff for a while I mean. I've been trying to find it, I haven't looked as hard as I should, or I probably would have found it. anyway, if you have it, could you post it, or a link to a site with it please. - Dale?
__________________
Server: Pass Website: MrCoolDale.com Current Project: As Of Yet - Uniquely Me Co-Winner: 2004 Surpassies - Ultimate Surpasser
|
|
|
|
|
|
#4 (permalink) |
|
SurPerson
On a golden path...
Joined in Jul 2004
Lives in front of my laptop
Hosted on Sync
437 posts
Gave thanks: 0
Thanked 1 Time in 1 Post
|
In the page with the IFrame:
Code:
<?php if(isset($HTTP_GET_VARS['page'])) {echo "<iframe src='{$HTTP_GET_VARS['page']}'>";} else {echo "<iframe src='default_page.php'>";}
?>
Code:
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
var u = window.self.location.href;
if( window.parent.location.href == u )
window.location.href = "http://www.ablast.info/index.php?page=<?php echo $sect;?>/" + u.substring( u.lastIndexOf( '/' ) + 1);;
//-->
</SCRIPT>
__________________
Me: TeeJay Server: Sync (Statistics) Site: technoized.com (Statistics) chown -R us ./base |
|
|
|
|
|
#5 (permalink) |
|
Uniquely Me
Super #1
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
|
TJ, two things:
One, since your name is TJ09, you really need a robot, some sort of mechwarrior, as your avatar. it would be quite fitting as everytime I read your name I picture a really awesome mech. second thing. Is that code for me or for jb? I'm guessing for jb with the nature of that coding, but I wasn't too sure. - Dale?
__________________
Server: Pass Website: MrCoolDale.com Current Project: As Of Yet - Uniquely Me Co-Winner: 2004 Surpassies - Ultimate Surpasser
|
|
|
|
|
|
#6 (permalink) |
|
Surpass Fan
Seasoned Poster
Joined in Sep 2003
Lives in Atlanta
Hosted on Pass67
49 posts
Gave thanks: 0
Thanked 0 times
|
Thanks for the replys and suggestions. You're definitely on target with using PHP to call the elements into the iframes. After I started this thread I hung around for a bit to read some of the other threads. The one started by "Apsylum" actually had the same suggestion about PHP and set me off in the right direction I needed.
My knowledge of coding comes to an abrupt halt after HTML. But I stayed up all night last night figuring out what a php include was and then experimenting with using it. I came to a couple of conclusions before I finished. 1: php ROCKS! 2: Iframes don't. There's such great potential in the use of iframes but when this standard was developed whoever decided to eliminate percentages to control the dimensions, really made iframes the least desirable of all layout tools. Thanks again, Jim B. |
|
|
|
|
|
#7 (permalink) |
|
Uniquely Me
Super #1
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
|
I don't like percentages, they're not all they're cracked up to be. You st a percentage which makes things different in 800x600 and 1280x1024. I like to make things fit into 800x600, maybe something a little extra to tag along with the better resolutions. just my opinion.
iFrames have a great place in some sites though: http://ArtistikRevolution.com/newjunk an iFrame makes things fit quite nicely, otherwise things would get distorted if I had more or less content in different pages. Keeps things where they should be. - Dale?
__________________
Server: Pass Website: MrCoolDale.com Current Project: As Of Yet - Uniquely Me Co-Winner: 2004 Surpassies - Ultimate Surpasser
|
|
|
|
|
|
#8 (permalink) | |
|
Surpass Fan
Seasoned Poster
Joined in Sep 2003
Lives in Atlanta
Hosted on Pass67
49 posts
Gave thanks: 0
Thanked 0 times
|
Quote:
I built a site at 800X600 and the lowest resolution on the client's laptop was 1024X768. He hated it! "Everything's tiny, I want it to fill the screen like all the other sites do". I re-built it at 1024X768 and the client was thankful and happy. Two days later he calls in a panic. "My brother in Phoenix and my aunt in Omaha can only see half the page!" Thank God I had kept the 800X600 version. I put them both online and used a javascript, "redirect on screen resolution" to automically send the visitor to the regular index if their screen size was greater than 800px, or to the alternate index if the screen resolution was less than 1024px. This worked, and kept iframes in my plans, even though it meant having to build two versions of every site I used them on. Then what recently turned me against iframes happened. Same client, this time it's his mother. Her eyesight's not so good so she uses the browser's "text size" option to increase all the displayed font sizes. Now all the text in an iframe no longer fits. I CAN enable scrolling in those iframes but then people have to scroll, not only up and down, but also left and right to read the text. Before I go, one other browser related issue with regards to building everything to a fixed size. Browser's viewing options! In particular the toolbar options at the top of the page. I have mine set for small icons but the default is a much larger icon that takes up a lot of the screen "real estate". Not to mention the ISP specfic browser like AOL's, Compuserve, Net Zero, Juno, etc. With all that advertising junk around both sides and across the top. I'm sure I'll still use iframes for some things but I'd rather try to build a single "fluid" design that'll fit anywhere anytime. Jim B . |
|
|
|
|
|
|
#9 (permalink) |
|
Uniquely Me
Super #1
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
|
to tell you the truth, when I build a site for myself (non-business related) I don't care what someone's viewign the site in, I make it look nice for myself. I have Firefox, mozilla, netscape, IE5, IE6, safari, and a few others. I test it in them, if it works, great, if not, I'm not going to spend a whole lot of time getting it to. When it comes to the AOL browser though, I don't care (unless of course it's business related). AOL is brutal on websites, it tears them apart, resizes them, shrinks images, expands banners; it's just brutal and unpredictable at times.
I have encountered much of what you're talking about, and that's when I put the content into a CSS type layout. only allow it to go so wide, but it can go as far down as it likes. As in the example I gave you though, I can't afford for anything to go side to side. it can go down though, that's just fine with me. - Dale?
__________________
Server: Pass Website: MrCoolDale.com Current Project: As Of Yet - Uniquely Me Co-Winner: 2004 Surpassies - Ultimate Surpasser
|
|
|
|