I'd like to map the title and link of the RSS feed (not each feed item but the title and url at the top of the feed) to a field in each post. I have read a few issues on similar topics but I'm not sure they are trying to do exactly this. Is this possible at the moment? I can't seem to find it anywhere
If it is not possible to do that as a workaround I was thinking of entering the information manually as a CCK on the feed node and using that to map to every feed item created from that feed. Can someone please point me to the function that needs to be altered of overridden.
Thanks for your help.
EDIT: for D7 look at #1689374: Map feed Title and feed URL
Comment | File | Size | Author |
---|---|---|---|
#19 | feeds-735530-map_title_description_link-1.patch | 2.36 KB | Yura |
#15 | feeds-735530-map_title_description_link.patch | 2.36 KB | mstrelan |
Comments
Comment #1
alex_b CreditAttribution: alex_b commentedThis feature would require restructuring and expanding the mapping API pretty significantly (how exactly I haven't figured out yet...). Unfortunately using a CCK field won't buy you anything. A good feature request though.
Comment #2
a_lawry CreditAttribution: a_lawry commentedThanks for the reply Alex. I'll have a look into the code and see if I can come up with a solution for my project.
Comment #3
a_lawry CreditAttribution: a_lawry commentedI changed the code myself. Added some lines to the process function of FeedsNodeProcessor to load the feed node read the cck field values and add them to the feed item node just before node_save() was called.
Would it be worth providing a hook for this kind of thing? So in the future people can write a module to post process the feed items before the node is saved. Then they can pull data from wherever they like.
Comment #4
alex_b CreditAttribution: alex_b commented#3: do you want to post your modifications as a patch?
Comment #5
a_lawry CreditAttribution: a_lawry commentedIt's probably not worth it. My changes were so specific to what I needed that it couldn't be used by anyone else. At best it would serve as an example of how I hacked it to get my functionality done. What do you think?
Comment #6
alex_b CreditAttribution: alex_b commented#5 Worth it :-)
Comment #7
Marc Ledergerber CreditAttribution: Marc Ledergerber commentedAny thoughts on how to enable taxonomy support for mapping fields using "Feed Node processor" when importing from local CSV file with standalone form?
Have you tried this? http://drupal.org/node/862874
Comment #8
seanberto CreditAttribution: seanberto commentedI'm looking map the title field to the feed field too. One of the benefits being that I can then use the editview module to provide a nice UI for editing a bunch of feed URLs in a single view.
I think that the quickest way to do this will be to write a little custom module that uses a hook_nodeapi call and a hook_form_alter for nodes of a given content type.
I can then package the custom module, content type definition, views definition, etc. into a little feature. My ultimate goal is to create a blogging feature that allows a blogger to quickly/easily maintain a list of feeds that all populate his/her blog. The current Feeds UI is great - but a bit too complex for my clients.
(Thanks for this great module!)
Comment #9
seanberto CreditAttribution: seanberto commentedWhoops, this isn't quite as easy as I thought, as Feeds seems to be doing it's own "title field" validation on the node add/edit forms. Exploring.... I'll post my solution.
Comment #10
apes132 CreditAttribution: apes132 commentedI too am looking to get this functionality. has anyone come up with a patch?
Comment #11
alex_b CreditAttribution: alex_b commentedSince #632920: Inherit properties from parent feed node (taxonomy, author, OG, language) got committed we are ***much*** closer to this feature request. All that needs to be done is to expose title, description, etc. via FeedsParser::getMappingSources() and set them via FeedsParser::getSourceElement().
This is a novice task.
Comment #12
bee2b CreditAttribution: bee2b commentedAny updates adding the feature to the next release of feeds?
Comment #13
mstrelan CreditAttribution: mstrelan commentedI think what alex_b is suggesting in #11 is something like below.
I think however what the OP (and myself) are after is the Title and URL from the RSS feed itself, rather than the Drupal node that imports the feed. For example if you look at http://drupal.org/node/feed you will notice the following before any tags
Is there a way we can expose this information?
Comment #14
mstrelan CreditAttribution: mstrelan commentedOMG I forgot to dpm the $batch variable. Please ignore #13, patch incoming.
Comment #15
mstrelan CreditAttribution: mstrelan commentedOk lets try again. Patch attached, first time on GIT so forgive me if I did it wrong. Has been tested mapping the title field from http://drupal.org/taxonomy/term/8/feed/feed to a text based CCK field and it worked perfectly for me. Let's hope this can get in quickly.
Comment #16
krem CreditAttribution: krem commentedHi there,
Thanks mstrelan for your patch, it has been a great help !
Still, I patched my 6.x-1.0-beta11 feeds module but it didn't work for the parent node title :
I had to set the $node variable within the condition :
I realise $node is set in the if condition but I could not access it... I'm curious why through, I'm not used to this kind of code in a "if" condition, if somebody has some php knowledge to share, please do!
Comment #17
planstoprosper CreditAttribution: planstoprosper commentedThe && and === operators both have higher precedence than the = operator. The line
needs to include parentheses around
$node = node_load($batch->feed_nid)
.That's why krem had to set
$node
again.Comment #18
geek-merlinfor the corresponding d7 issue look here: #1689374: Map feed Title and feed URL
Comment #19
Yura CreditAttribution: Yura commented#17 wrapped in parentheses
Comment #19.0
Yura CreditAttribution: Yura commentedadded d7 link
Comment #20
twistor CreditAttribution: twistor as a volunteer commented