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.

CommentFileSizeAuthor
#1 action_nodetype.txt1.38 KBdrowlflood
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drowlflood’s picture

Status: Active » Needs review
FileSize
1.38 KB

Here'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.