Generic feed element to standard node field mapper
aaron - March 25, 2008 - 16:20
| Project: | Feed Element Mapper |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
seems like it would be useful to allow the mapper to map to the $node->body element, such as, for instance, when mapping to an unadulterated blog node.

#1
Subscribing, very interested. Greetings, Martijn
#2
Would be great. This could be done by a generic mapper that maps to title, body, created = all standard fields on a node.
#3
hi alex_b,
tried you approach and got stuck. Eventually created two vocabularies for the feed content type: custom body-field-override and title-field-override. I adjusted feedapi_node.module. The module now checks whether custom-body-field-override and/or custom-field-tag-override is set. if yes, it uses the terms of the custom-body-field and/or custom-title-field vocabularies(for example options--enclosures--application--x-shockwave-flash--0--description and options--enclosures--application--x-shockwave-flash--0--title) instead of the the default rss fields (description and title) to populate the title and body of the node that is created from the feed-item.
The modified file is attached
#4
As for the author. It doesn't make sense to map the author of an feed-item to the drupal node-author, because node-authors must be existing drupal users. So I created a cck-field called author and mapped the author to that field.
#5
Generally this is a good idea to have a generic element -> node field mapper.
I have suggestions about the implementation:
Do not modify feedapi_node
Create a new module with bigger weight than feedapi_node and implement hook_nodeapi(). And after that, check if it's a feed node item and do the modifications as you do in the modified feedapi_node
#6
mapping to title, body, created date is part of FeedAPI Mapper now. There are open threads for related issues:
#373368: Mapper for $node->status
#363326: Mapper for $node->uid
#341377: Mapper for node title, body, etc
#7
Automatically closed -- issue fixed for 2 weeks with no activity.