0

In Drupal 7, is there a way to auto-create a node of "Type B" whenever a node of "Type A" has been created? Ideally, certain info would be passed on to the new "Type B" content item as well. For instance...

Let's say I create a new Type A content item, and that the Type A content type has several CCK fields. One of those CCK fields is a Node Reference field, which refers to content items of "Type C". Another of the CCK fields in Type A is a basic integer/text field.

When I create that new Type A content item, I choose "Content Type C Content Item #1" from the Node Reference drop-down select list. I also add "100" to the integer/text field. I'd then like a new Type B content item to be auto-created, with the same node reference info in its own node ref CCK field and the same integer/text in its own integer/text CCK field.

The purpose of this is to track usages of parts in sort of a macro and micro situation... Type C is the macro/master, Type A is the sub-macro/sub-master (if that makes sense) and Type B is the micro/slave of Type A. There will be many Type B's associated with a single Type A, but there will likely only be a single Type A content item associated with any given Type C content item.

I'm open to any all all suggestions, including scrapping this implementation concept in favor of something else that might work better and might be easier to manage.

Thanks!

1 Answer 1

0

You can do this kind of stuff with Rules. You could also look into hook_node_presave() yourself and do logic when nodes of TypeA are being saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.