Right now in mediarssapi_format_item() there is no way to passing other RSS tag information like description, GUID, and so on. I wanted to do somethign like this
$item = array(
'title' => $file->filename,
'description' => $node->title . ' ' . $file->filename,
'link' => url('node/' . $node->nid, NULL, NULL, TRUE),
'thumbnail' => file_create_url($file->filepath),
'content' => file_create_url($file->filepath),
);
$items .= mediarssapi_format_item($item);
Description is ignored. I think it would be nice to be able to format a complete RSS tag and for that matter.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 300281.patch | 1.53 KB | dldege |
| #3 | 300281.patch | 1.34 KB | dldege |
Comments
Comment #1
swentel commentedIt resembles a bit like this request: http://drupal.org/node/299196
I'm not sure yet how I'm going to implement it, but it will definitely happen!
More news later.
Comment #2
dldege commentedYes, its similar but I think the approach in that issue is wrong because I don't agree with using the theme layer for what I consider non-display logic. This is however just my preference. For what I described above I'd suggest using format_rss_item, http://api.drupal.org/api/function/format_rss_item/5, which is already set up to handle extra keys. All you need to add in your API layer is maybe something that formats media xlmns items to include the namespace. So in this way your modules handling of building the items is exactly the same as the method used in nodeapi rss item. Changing this would also make it easy to facilitate support for rss item as I mentioned in http://drupal.org/node/300327.
Comment #3
dldege commentedHere's a patch that I think covers it and makes the RSS feed a lot more flexible.
Please review and then I think its RTBC.
Comment #4
swentel commentedI think it needs some work, after applying the patch, an item in the feed looks like this:
As you can see the title and link tag are rendered twice in the xml, I think we should change the call to format_rss_item to
and also unset title, link & description from the item array. What do you think ?
Comment #5
dldege commentedYes, in fact I had that in in there and I attached the wrong patch above.
Here is the right patch.
Thanks for testing and catching this.
Comment #6
swentel commentedyep, much better, rtbc!
Comment #7
dldege commentedFixed in piclens.module version 1.1.2.30
@swentel I'm not sure how I/you manage porting this to the D6 branch.
Comment #8
swentel commentedThis patch applies with some fuzz on Drupal 6 branch, not tested though with actual rss output (have no local installation right now), but if it's ok, apply it.
Comment #9
swentel commentedchanging status
Comment #10
swentel commentedcommited to D6 branch.
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.