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 would like to be able to use the enclosure element formatter for a field other than Image or File; for example, I have a field that contains the URL to an MP3 file on another server, but I want to use this URL as the enclosure. Thank you for your work on this!
Comment | File | Size | Author |
---|---|---|---|
#12 | views_rss-embedded_field_support-1561506.patch | 3.3 KB | merauluka |
Comments
Comment #1
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedWhat type of field exactly are you talking about?
Comment #2
jhenderson CreditAttribution: jhenderson commentedIt's a text field only—it's not taking any file upload, but it's referring a path to a file on another server.
Comment #3
jhenderson CreditAttribution: jhenderson commentedComment #4
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedThought it over, and I am not going to implement this I am afraid. All three attributes of
<enclosure>
element are required by RSS specification - url, length and type, while simple text field could provide value for url attribute only, as there is no way to store other 2 attributes there as well. Therefore such element (and thus the whole feed) would not be able to validate.Comment #5
jhenderson CreditAttribution: jhenderson commentedUnderstandable, and thank you for your reply. Is there any way I can possibly rewrite the enclosure field manually, or include other fields (for length and type) in the content type to use these tokens in the
<enclosure>
?Right now my company has podcasts based on RSS feeds in which I have to manually input new posts every day, as well as inputting information in the website itself. Views RSS is absolutely perfect for me to input the information once only in the content type and have it automatically publish my RSS feeds, except the formatting for this one element. I appreciate your consideration and time into this project.
Comment #6
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedA quick update on this - as Dan has unintentionally submitted a great idea on how this could be solved, both text and link_field fields could now be used to store
<enclosure>
URLs (and type and length attributes will be generated automatically). New 7.x-2.x-dev version just pushed to d.o, 6.x to follow.Comment #7
jhenderson CreditAttribution: jhenderson commentedThank you so much! This is an amazing fix, and I really appreciate your help!
Comment #8
mattcasey CreditAttribution: mattcasey commentedIs there a way to add a video from CCK Embedded Media in the enclosure?
Comment #10
pkraft CreditAttribution: pkraft commentedI have tried version 7.x-2.x-dev that maciej posted but I cannot get it to work and I am afraid there is a simple setting that I have wrong.I am trying to use a text field for the enclosure that contains a URL pointing to the externally hosted media. The media is an h.264 video hosted on our CDN.I have chosen theRSS<enclosure>element
formatting and the URL is populating the field in the data base but an tag is not being rendered.Are there any other settings that I need to look for when using a text field as the enclosure element?Thanks in advance for any help.Nevermind. I fixed it and the solution was too embarrassing to share.
Comment #11
HarrisonHill CreditAttribution: HarrisonHill commentedmaciej.zgadzaj said that drupal 6 version will follow but this doesn't work with latest dev version for drupal 6.
Any updates or maybe there is any way to get it working with drupal 6? Is there a way to grab manually entered length and type fields from CCK field and then append them to enclosure?
Comment #12
merauluka CreditAttribution: merauluka commentedI made a patch for this. It's probably sloppy because I am new to this, but I added the ability to pull Embedded Media Field audio and video files into the enclosure tag.
I've tested it on my development system. Would someone here give it a try?
-Melissa
Comment #12.0
merauluka CreditAttribution: merauluka commentedEdit
Comment #15
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedSupport for
text
andlink
fields has been added to 6.x-2.x as well.