Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2010 at 16:29 UTC
Updated:
30 Aug 2010 at 12:34 UTC
I am trying to figure out what to map "Enclosure" to. Can some one give me the best practice ? What do you nmap "Enclosure" to for common google news type feeds?
Comments
Comment #1
AntiNSA commentedAnyone? I really want to try to use it to show embedded media from a stream like democracy now! and I dont know what to map it to... someone plese give me a clue?
Comment #2
CheezItMan commentedIf you get feedback on this I'd love to hear it.
Comment #3
alex_b commentedA filefield is a good example: http://drupal.org/project/filefield
Comment #4
AntiNSA commentedSo If I install filefiled, and then create a block for filefield from views, filefied can automatically detect the embedded media and play it no matter if it is flash or real video or whatever?
Comment #5
buddaEnclosures are just URLs to media on a remote server. Simply map the URL to a CCK textfield then use SWFTools module to theme the URL to a suitable video/audio player etc.
Also take a look at emfield as an alternative to the above, although it requires a patch to add emfield fieldtype mapping to Feeds.
Comment #6
cglusky commentedAs another example, I am mapping enclosures from a feed of a flikr photoset to an imagefield and it works fine. Needed Enclosure support to get at the large image instead of the image you get via the URL mapping.
R,
C
Comment #7
reikiman commentedI believe the discussion for this issue is too simplistic. One of my sites is a podcast & blog directory which has a hundred or so feeds right now and could have a lot more over time. It's using FeedAPI
..so.. one thing I've seen after looking at a dozen or so podcast RSS feeds is that "Enclosure" is not enough in podcast feeds. Podcasts can also include iTunes or other meta data. Unfortunately there is no consistency between the feeds I've looked at.
..so.. I end up having a lot of per-feed custom mapping because there is no consistency. Unfortunately Feeds doesn't support per-feed custom stuff.
That'll work somewhat. If you want the aggregated items to become a podcast in their own right there is a need to have the Enclosure data become an Enclosure in generated RSS feeds. Also the Enclosure tag has four data items, the URL (as you said), the MIME type, the size, and a description. There's a module whose name I'm forgetting at the moment which will do this ("RSS Remote Enclosures"?) but it will need some work. I think it should a) become a CCK field (or in D7 a Field), b) have a mapper that handles podcast elements from a feed
Comment #8
alex_b commentedRight.
That's one way of doing it. I would argue that it is the parser's responsibility to create consistency.
This is exactly what e. g. simplepie or common_syndication_parser are already doing for source elements like e. g. title, description, author, url, guid, etc. It's called 'normalization'.
Enclosures aren't normalized well, I hear (not using them much myself). Plan of action to fix enclosure handling would be:
1) identify common denominator (= normalized enclosure)
2) write parsing code that maps cleanly to these common denominator (most likely in common_syndication_parser).
Thus you don't have to use multiple mappings per feed and we actually get to share our knowledge on 'where is this thingy on feed x' beyond our web site's confines.
Comment #9
Marko B commentedI installed simplepie parser to use enclosuers, mapped enclosure to body field, just for testing and then importing feed, enclosure looks like
but i get nothing in body field? should work, at least put html code, input format is set to full html but nothing is parsed to body, any ideas why?
Comment #10
Marko B commentedWhen i switched from body to filefield its working fine, problem is enclosure isnt just url its " An array of enclosures attached to the feed item." so its an array and then you need to pass it to some field with parser for array i guess. so budda comments are wrong about that it can be any field.
Comment #11
AntiNSA commentedSo the thing is you mapped an enclosure, which is the image... was this just an inline image as included in the feed body? I am having a big problem that the images that are included in teasers are taking up way do much space in the teaser, and must figure out how to resize them eventually. But, lets say you create a filefield (forgive me, a month or 2 since I created any filefields) and instead of an image , there was a youtube or other media attachement.... filefield would beable to differentiate between image and youtube and all would be good and displayed nicely?
Comment #12
Marko B commentedDont know how filefield handles videos, guessing you have to have some media field for this in additions as filefield would probably just display link of your video.
Comment #13
alex_b commented#10: single value target fields should just grab the first item of an array and display it. If that's not the case, please open a separate issue.
Added the answer to the original question to the FAQ list: #836618-8: Compile FAQs
Closing this issue.