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."

CommentFileSizeAuthor
#7 feedapi_node.rules_.inc_.txt467 byteskilles@www.drop.org

Comments

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not sure I understand. Did you try to Load a content by ID, and used the token of the CCK field?

mitchell’s picture

That 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?

fago’s picture

Title: Populating fields in feedapi node items with values from their feedapi feed » provide rules integration
Project: Rules » FeedAPI
Component: Provided module integration » Code feedapi (core module)
Category: support » feature
Status: Postponed (maintainer needs more info) » Active
Issue tags: +rules integration

You 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.

mitchell’s picture

Title: provide rules integration » Provide rules integration

@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?

fago’s picture

>@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.

KoCo’s picture

I 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.

killes@www.drop.org’s picture

Status: Active » Needs review
StatusFileSize
new467 bytes

Here's a small rules file that checks if a node was created through feedapi.

fago’s picture

Status: Needs review » Needs work

Code 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.. ;)