Example of default bundle can be found in Profile2 module in profile2.install file:
function profile2_install() {
// Add an initial profile type, but only if installed manually. In case the
// module is installed via an installation profile, skip that.
if (!drupal_installation_attempted()) {
$type = entity_create('profile2_type', array(
'type' => 'main',
'label' => t('Main profile'),
'weight' => 0,
'data' => array('registration' => TRUE, 'use_page' => TRUE),
));
$type->save();
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('edit own main profile', 'view own main profile'));
drupal_set_message(t('A main profile type has been created and assigned to all users. Go to the <a href="!url">Profile types</a> page to add some fields or to configure further profile types.', array('!url' => url('admin/structure/profiles'))));
}
}
You can create bundle by going to admin/structure/model_types. I think the main point is to create custom bundles from the CMS, similar to entity types. I don't think having some default bundle have any outcome.
Comments
Comment #1
manuelBS commented+1
Comment #2
Toxid commentedI've been strugling with this for a while and would very much like to see it in this module. I find the menu part especially confusing.
Comment #3
nobarte commentedExample of default bundle can be found in Profile2 module in profile2.install file:
In the case of Model module:
Comment #4
kenorb commentedYou can create bundle by going to admin/structure/model_types. I think the main point is to create custom bundles from the CMS, similar to entity types. I don't think having some default bundle have any outcome.
For some code examples, check: How do I programmatically create an entity with its fields?
Comment #5
kenorb commented