Wednesday, February 11, 2009

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'),
);

R.Navaneethakrishnan
http://navaneethakrishnan-drupal.blogspot.com/

No comments:

Post a Comment