To add taxonomy in drupal custom form.
By using taxonomy_form() we can form a texonomy in form.
For Ex:
$vid=4;
$category1 = taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy');
$form['taxonomy_info']['taxonomy1'] = array(
'#type' => 'select',
'#title' => t('Terms for the Website'),
'#options' => $category1,
'#description' => t('Website category'),
);
For Ex:
$vid=4;
$category1 = taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy');
$form['taxonomy_info']['taxonomy1'] = array(
'#type' => 'select',
'#title' => t('Terms for the Website'),
'#options' => $category1,
'#description' => t('Website category'),
);
Comments
Post a Comment