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.

CommentFileSizeAuthor
#3 feedapi_node.module.txt18.92 KBbuzink

Comments

summit’s picture

Subscribing, very interested. Greetings, Martijn

alex_b’s picture

Title: feed to content body? » Generic feed element to stadard node field mapper

Would be great. This could be done by a generic mapper that maps to title, body, created = all standard fields on a node.

buzink’s picture

Status: Active » Needs review
StatusFileSize
new18.92 KB

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

buzink’s picture

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.

aron novak’s picture

Status: Needs review » Needs work

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

alex_b’s picture

Title: Generic feed element to stadard node field mapper » Generic feed element to standard node field mapper
Status: Needs work » Fixed

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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.