Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wanted a content:encoded item for my feeds so I made a small extension module to implement it. Feedback would be appreciated: http://github.com/guictx/views_rss_content
Comments
Comment #1
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedThanks Guilherme. Essentially it looks good, few quick thoughts though after looking at the code (haven't tested it yet):
views_rss_content_views_rss_item_content()
function andpreprocess functions
key fromviews_rss_content_views_rss_item_elements()
definition;title
key fromcontent:encoded
element definition - it will be automatically extracted from element name;help
key with value eitherhttp://www.feedforall.com/content.htm
orhttp://web.resource.org/rss/1.0/modules/content/
(the latter is more extensive, I would go with the former though I think, as it is more clear and easier to read, especially in RSS context);<content:encoded>
element could be added both to the<channel>
and the<item>
sections - so perhaps it would be good to implementhook_views_rss_channel_elements()
too?Don't you want to submit this module to d.o yourself?
Comment #2
guictx CreditAttribution: guictx commentedThank you so much for the review Maciej. I followed your suggestions and changed:
1. Removed
views_rss_content_views_rss_item_content()
- latest dev correctly encodes the element, so no need for CDATA-escaping;2. Removed
title
key;3. Added
help
key pointing tohttp://www.feedforall.com/content.htm
;4. Added
views_rss_rewrite_relative_paths
as a preprocess function to make sure links incontent:encoded
are absolute.Regarding the implementation of hook_views_rss_channel_elements() I'm not so sure. The spec is a little bit ambiguous regarding
<channel>
and the RSS Best Practices document doesn't mention it. What do you think about it?And I'll go ahead and submit the module.
Thanks again!
Comment #3
guictx CreditAttribution: guictx commentedI created a sandbox: http://drupal.org/sandbox/guictx/1549874 .
Comment #4
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedJust given it a quick test ride and all seems to be working fine. Coder does not report any issues either. Please just remove
LICENSE.txt
file from the repo (it will be added automatically by d.o) and renameREADME.md
toREADME.txt
(perhaps wrapping its long lines at the same time) and you're good to go! (At least based on what I can see.)Comment #5
guictx CreditAttribution: guictx commentedI finally got around to submit the project application for this: http://drupal.org/node/1626446.
Comment #6
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedGuilherme, I have read the comments in the Project Applications queue, and - if you want - I could create a new full project from this and make you a co-maintainer?
Comment #7
guictx CreditAttribution: guictx commentedOK, lets do that!
Thanks.
Comment #8
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedhttp://drupal.org/project/views_rss_content - you have empty project and all permissions. Into your hands now!