I have these CCK node types:
Profile first name and last name
Syndicated Column a feedapi feed that creates 'External Articles,' and has a node reference to a profile
External Article the feedapi node item, and has a node reference to a profile
My goal is to use rules to load the syndicated column and populate the profile node reference on incoming external articles. The problem is I cannot find a way to load the feed node to retrieve its node reference value when using "Content of 'External Article' is being saved."
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | feedapi_node.rules_.inc_.txt | 467 bytes | killes@www.drop.org |
Comments
Comment #1
amitaibuI'm not sure I understand. Did you try to Load a content by ID, and used the token of the CCK field?
Comment #2
mitchell commentedThat works when manually entering the nid of the feedapi feed, but is it possible to load the feed's nid relative to the feedapi item that is about to be saved?
Comment #3
fagoYou would just need a feed api event that makes the node available once it has been created by it. Best it would make the feed node available too.
Then you can use the existing actions with it, e.g. populate a field. There is also an action to load a referenced node, so that would be all you need.
Comment #4
mitchell commented@fago: Why would a feed api event be necessary? Can't this already be done with a regular "node is created"?
What else might feedapi's rules integration look like?
Comment #5
fago>@fago: Why would a feed api event be necessary? Can't this already be done with a regular "node is created"?
ehm, of course. Sry. I suppose a condition for checking whether a node is feed item and an action to load a feed items feed node would be useful.
Comment #6
KoCo commentedI refer to #353340: Token integration.
It would be very useful to have a rule to copy or add fields from the parent node, but if their are multiple parent nodes it becomes a bit tricky. Maybe one could pick a primary parent node and put that in a token?
Nevertheless, very interested in such a feature.
For now:
_ created a custom token, getting the first value from "$node->feedapi_node->feed_nids"
_ then added a rule with condition content type "feed-item"
_ when saved or updated, it loads the content from the parent node
_ then uses it to populate some cck fields
This works, but I fear a drastic overload when updating via cron, or just refreshing a very long list.
Comment #7
killes@www.drop.org commentedHere's a small rules file that checks if a node was created through feedapi.
Comment #8
fagoCode basically looks fine.
* If you don't have help, leave it out.
* Module is just used in the UI for grouping purposes, so you could even just use 'FeedAPI' there.
* Missing doxygen.. ;)