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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | feedapi_node.module.txt | 18.92 KB | buzink |
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | feedapi_node.module.txt | 18.92 KB | buzink |
Comments
Comment #1
summit commentedSubscribing, very interested. Greetings, Martijn
Comment #2
alex_b commentedWould be great. This could be done by a generic mapper that maps to title, body, created = all standard fields on a node.
Comment #3
buzink commentedhi 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
Comment #4
buzink commentedAs 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.
Comment #5
aron novakGenerally 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
Comment #6
alex_b commentedmapping 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