By zkday on
How to get bundle info in hook_form_alter when user create new or edit entity content. (e.g: create page, edit page).
function mymodule_form_alter($form, $form_state, $form_id) {
// how to get bundle name here?
}
How to get bundle info in hook_form_alter when user create new or edit entity content. (e.g: create page, edit page).
function mymodule_form_alter($form, $form_state, $form_id) {
// how to get bundle name here?
}
Comments
Try to use hook_nodeapi
Hello,
You can also try with hook_nodeapi()
Thanks,
Thanks for reply! ;) In
Thanks for reply! ;)
In drupal 7, I want get a bundle of entity when hook_form_alter.
example: i'm create 2 module: myentity and mymodule.
in module: myentity
1 - create a new entity with name is "myentity" (using hook_entity_info).
2 - i'm create a function mymodule_form, this is the form for create/edit a entity content.
in module: mydemo
i'm using hook_form_alter
See this post
See this post :http://www.istos.it/blog/drupal-entities/drupal-entities-part-3-programm...
You don't need to form_alter.. just create a new form with the field required in your custom entity... have your validate / submit form hook, then let your entity controller handle the rest