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.
By najubudeen on
hi, i have added a menu named vt menu with the system's menu proggrammatically. i try to create a custom content type with fields.
i want to change content type's default parent item to vt menu during module installation. i have added my hook_install codes below.
what functions do i need to add along with my hook_install function to achieve this?
here is my vt_tech.install file
function vt_tech_install() {
node_types_rebuild();
$types = node_type_get_types();
foreach (_vt_tech_installed_fields() as $field) {
field_create_field($field);
}
foreach (_vt_tech_installed_instances() as $instance) {
$instance['entity_type'] = 'node';
$instance['bundle'] = 'vt_tech';
field_create_instance($instance);
}
variable_set('comment_vt_tech', COMMENT_NODE_CLOSED);
}