Currently, when using %baseurl, this is substituted with the host-relative base URL.

While this works neatly with pages when displayed in a normal HTML page context on the original site, it breaks when used with RSS agregations, and other forms of content aggregation. It would therefore be useful to be able to have the module optionally output fully absolute URLs, include the host part.

The suggest patch adds this optional behaviour, and a setting to enable it. It is disabled by default to maintain consistency with previous versions.

Comments

David Lesieur’s picture

Good point... In fact, does it make any sense to maintain the current behavior? Given the problems it can cause and that you have pointed out, I doubt anyone would want it.

fgm’s picture

Actually, I suppose that not everyone wants his content to be aggregatable (?), and emitting full absolute URLs also has a slight bandwidth and readability cost above normal site-relative URLs. So I think it makes sense to keep your default behaviour as it currently is.

David Lesieur’s picture

Then how about adding a new token such as %baseurl-absolute instead of creating a new setting? That would allow more fine-grained configuration. I also think it would give the option more visibility than having it as a setting on a separate page.

It would also be useful to explain why one would choose absolute rather than relative, perhaps a statement like: "Some content aggregators might not be able to reference elements with relative URLs".

fgm’s picture

StatusFileSize
new3.39 KB

Here is the module patched as suggested. I also included a README change mentioning both the new token and the uninstall procedure.

The .install file for uninstall can't be included in the patch since it does not yet exist. See http://drupal.org/node/255332 for its contents.

David Lesieur’s picture

I have not tested the patch, but it looks good. I have granted you CVS access to the module, if you have tested the patch thoroughly and would like to commit it yourself. ;)

My only suggestion would be for the readme file to mention that some aggregators may have problems with relative URLs.

An aggregating site that would republish relative URLs as-is would just be a buggy one. AFAIK, Drupal's core aggregator, FeedAPI or SimpleFeed modules do not have such problems.

Thanks!

fgm’s picture

StatusFileSize
new2.23 KB

Well, technically, the item content in RSS 0.9x and 2.0 feeds is not supposed to be an HTML fragment. Its format is just undefined, so "by the book" it is not broken : the RSS 0.91 considers the "item" content may be HTML, but does not suppose it is, with mentions like when the channel is rendered in HTML.

See http://backend.userland.com/stories/rss091 and http://cyber.law.harvard.edu/rss/rss.html for the full RSS 0.91 and 2.0 specifications. RSS 1.0 and Atom are a different story, though.

This being said, for most practical purposes today, the item content is an encoded HTML fragment, so aggregators should probably parse links, and I reworded the README in this new patch. Do you think this is better ?

David Lesieur’s picture

The new README looks good to me. Thanks for the change!
Thanks also for the clarification regarding RSS.

fgm’s picture

So do you think we can commit this ? (set RTBC if applicable).

Since there are no other pending issues, it could be an occasion to make a new release: the previous one is almost one year old.

fgm’s picture

Bumping request: we could also apply it to the new 6.x branch.

David Lesieur’s picture

Version: 5.x-1.0 » 6.x-1.x-dev

I agree with the idea. Haven't set the patch to RTBC because I haven't tested it, but feel free to commit it if you have tested it thoroughly and think it is ready. Thanks!

fgm’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

It's now 8.x time, and this module is not needed on 8.x, so won't fix.