I am creating a content type in a module so that it gets created on install.

I got the fields and field instances in separate files and include those files in the .install file. I then call field_create_field() and field_create_instance() in the install file.

However, I also have conditional_fields for this content type. I have the code to create the conditions, what I need to know is what function do I now call from the .install file like I did with the other two field functions?

1 Answer 1


I ended up getting this to work by creating a feature for the node and copying the array to the module.

To get the 'ID' of the dependee and dependent, I used field_info_instance. After I had that I could pass that info to conditional_fields_dependency_insert.

I did all this in hook_install.

Your Answer

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

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