There are some stupid RSS readers, typically to be embedded into simple static HTML pages, rendering the feed's contents inside iframe. If the incoming feed is from a Drupal site, the "Read more" link opens inside the same iframe (i.e. tiny box inside some other site), which is ugly and almost unusable. This was recently reported as a bug to the site I maintain.
Although this is not strictly Drupal's fault, I think it would be nice if we included the 'target' attribute, providing a truly interoperable feed (as today's web-based reader-applications stand). Since the link is rendered by it's own l() call, it's pretty easy to add the target="_top"
attribute, which doesn't change the existing behavior in any other way, except breaking out of iframes.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#3 | feed-target_blank.patch | 754 bytes | JirkaRybka |
#1 | feed-target_2.patch | 752 bytes | RobLoach |
feed-target.patch | 717 bytes | JirkaRybka | |
Comments
Comment #1
RobLoachThere was an offset, so I updated it to HEAD.... Although the patch works, I'm not sure how it effects the majority of RSS readers.
Comment #2
Gábor HojtsyHm, why not target="_blank"?
Comment #3
JirkaRybka CreditAttribution: JirkaRybka commentedI would be absolutely fine with "_blank" - in fact THAT was what my site needed, and was originally in my patch. But I realized later, that it in fact changes the behavior (post-beta too), throwing new windows, so I thought "_top" is less intrusive and so more acceptable. It's a matter of taste thing, feel free to choose. :)
As for #1 "how it affects" - In general, it's a bit unlucky to render links and put into the content area (all other URL's in the feed are defined separately, and so rendered by the reader then), but removing the pre-rendered "read more" link smells like post-freeze feature to me (although it would be not much of a change, there's a link to the post in the feed anyway). The idea of removal is also supported by the bug report I originally received on my site, but I consider it most intrusive of the three.
Attaching an alternative patch with "_blank" (just a quick edit to #1 attachment, which applies cleanly too).
Comment #4
RobLoachExcellent.
Comment #5
Gábor HojtsyOK, committed.
Comment #6
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.