By drupalian on
hi
I am getting news article links using the aggregator module. However, when the users click the links, they are taken to the destination site (i.e. the source of that rss feed). However, I would like to keep the users on my site when they click on the links i.e. without redirecting them to the desination site of the article. How do I go about doing that?
Thanks
drupalian
Comments
Don't provide links to external sites then.
Don't provide links to external sites then.
This is the web. You link to a site. People click on the link. They go to that site. Problem?
I will not advise leeching like rhinocerus.net does or any other method that will steal another sites content without actually linking to the source.
However, to prevent your own site context being lost when folk go browsing, the reasonable approach is to
target="_new"all external links. Thus outside links open in new window..dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
What's the deal
Yeah, what's the deal with these sites that, specifically, suck the content from Drupal.org (I guess like rhinoserus); and generally, that suck content from other web sites and post it on their own site? It sure seem unfair. I've found snippets and pages from my sites on other sites many times over the years. And I don't like it.
The RSS feed is meant for people to read the content in a reader when it's updated, instead of having to go to various websites and check for new content, but the RSS feeds are really getting abused as just a way to load up a leech website with content.
I hope the G is smart enough to put these leeches at the bottom of the ranks where they belong. Although there is an argument that a good aggregator does good filtering, so that the user gets concentrated and quality info, but that's on the backs of us hard working content bulders.
,
As dan said above, it's wrong. And in most cases violates copyright.
http://drupal.org/project/leech
As dman said force the
As dman said force the browser to open a new window. If you edit aggregator.module (keep a copy of the unchanged file) I believe around line 1326 if you change it to something like this
$output .= '<a href="'. check_url($item->link) .'" target="_new">'. check_plain($item->title) ."</a>\n";users will be able to stay on your site and still follow the link. Unless I misunderstand and you want to leech the articles like the others suggest.
target=new
hi
I like the target=new idea. I would like to open in a new tab instead of opening up a new window. How can I do that in aggregator module? If someone can share the code, that will be great.
Thanks
drupalian
target deprecated
Keep in mind that the target attribute has been deprecated from HTML 4.0.1 onwards (and is considered entirely invalid in XHTML). According to W3C standards, there is therefore no way to force the client to open links in a new page; this should only happen when the client is instructed to do so by the user.
If you really need to, the following JavaScript will do (and will gracefully degrade when Javascript is enabled):
However, there is no way to instruct the browser to open a new tab, only new windows. Firefox users can configure their browsers to open a new tab instead when the site wants it to open in a new window (this will affect both the target attribute and the Javascript above).
Um, no.
The script you pasted will actually:
:(
search for some examples if you really want to try doing it with JS. But I wouldn't.
I know, but don't agree with the dropping of 'target' behaviour. I don't think ANY browsers are ever going to stop implementing it.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Tried it
I don't know about the keyboard navigation part (to be honest, I'd just drop the onkeypress entirely - as far as I can tell, the link would open normally if navigated by keyboard then, which is no problem), but I have clicked on the link. It opened in a new tab with Firefox for me...
Hm. You are right. I thought
Hm. You are right.
I thought the default target used to be "_self". Looks like it's working as "_blank" on todays browser.
Seems inconsistant, but yep, leaving it off is working like you want. :-/
The only reason you'd have onkeypress there at all is for keyboard navigation, so yep, I'd say it's redundant.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
External Links module
Have you looked at the external links module (http://drupal.org/project/extlink)? It also solved some issues with outbound link in menus, at least for me. And, content providers will not have to learn about anchor tags if they stick an address in posts.
interesting
I didn't know about external links module. Sounds interesting and might solve my issue. Let me play around with it.
Thank you
drupalian