views:

24

answers:

3

I will be displaying news feeds from external websites on my website. So i need to open external links in those feeds in a new window, but give the user an option to return to my website.

Basically I'm trying to replicate Google Images' technique of opening a link in a window with 2 frames - with the top frame having an option to "Remove Frame" and the bottom frame displaying the content of the link.

Also, since the news feed will be dynamic, I don't want to hard-code anything. The code should be used automatically by any link appearing in the news feeds.

Any ideas on how to do it?

A: 

If you're going to be opening the feeds in a new window/tab, the user already has the option of returning to your site by closing the window/tab. I would advise that you not go out of the way to replicate functionality provided by the browser.

Jim Greenleaf
Well, its for a client and they insist on adding this functionality!
Kartik Rao
Isn't that the worst?
Jim Greenleaf
I agree that your client's request is a stupid one. It will give a terrible user experience.What's the point? You see a news story you'd like to read, you click it and it opens in a new tab. Now what? You click "remove frame". Now your user is gone.It sounds like your client is trying to make money off of other people's content. That's a bad business plan.
jeph perro
+1  A: 

Assuming you are constructing the link by parsing an RSS feed, I would open a new window and display the news item within an iframe on your site.

If the RSS feed looks like this, for example

    <item> 
            <title>Apple delays iPad's global launch</title> 
            <link>http://www.cbc.ca/technology/story/2010/04/14/tech-ipad-launch-delay.html?ref=rss&lt;/link&gt; 
            <guid isPermaLink="false">2000360126</guid> 
            <pubDate>Wed, 14 Apr 2010 11:20:49 EDT</pubDate> 
            <description>The launch of the iPad tablet outside the U.S. will be delayed one month until the end of May, Apple Inc. has announced.
            </description> 
        </item> 

parse out the link and create some HTML like this:

<a href="myiframe.php?story-url=http://www.cbc.ca/technology/story/2010/04/14/tech-ipad-launch-delay.html?ref=rss" >he launch of the iPad tablet outside ...</a>

Then you create a page called myiframe.php. It displays an outer frame of your website with a link somewhere to return, and in the center displays the URL from the RSS feed ( which was passed as a parameter ).

jeph perro
A: 

I've decided to not implement this. Managed to convince my client that its a bad idea. Anyways, thanks for your solutions!

Kartik Rao