Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to create an action that changes a nodes content type to a blog post.
How would I go about making it convert a node to a certain content type when a a cck(or other type of) checkbox is checked when submitting a node.
Even though the nodetypemodule is installed I don't get "Change nodes content type" as an option in the actions configuration.
Comment | File | Size | Author |
---|---|---|---|
#1 | action_nodetype.txt | 1.38 KB | drowlflood |
Comments
Comment #1
drowlflood CreditAttribution: drowlflood commentedHere's some quick code that seems to do the trick. Just copy and paste the attached function to the end of your nodetype.module (not a patch file).
No checks are performed to see that field data will map correctly across node types, so use at your own risk. Generally, though, if the resulting node type contains each of the original node's fields it should work.