If so, create a custom submit callback in your module and in this callback you can use the function taxonomy_term_save($term);.
Where $term is an object containing at least the name you want to save and the vid (vocabulary) you want the term saved to.
The nice thing about this is that the saved $term will be return, so you can use the term id for further coding purposes. When you catch the results in a variable ($result = taxonomy_term_save($term);) the variable $result will contain a TRUE or FALSE based upon the succes of the save action.
No I want to assign a taxonomy tag to a page created by this function
function caninecolorcalc_menu() {
$items = array();
$items['canine/puppy-color-calculator'] = array( //this creates a URL that will call this form at "examples/form-example"
'title' => 'Puppy Coat Color Calculator', //page title
// 'description' => 'A Calculator that determines chances of a foals genotype based on sire and dams genotype ',
'page callback' => 'drupal_get_form', //this is the function that will be called when the page is accessed. for a form, use drupal_get_form
'page arguments' => array('caninecolorcalc_form'), //put the name of the form here
'access callback' => TRUE,
);
return $items;
}
Forms might not be considered content within drupal but my forms are content on my site and they need to be categorized as such. I will eventually have one for each taxonomy on the site. You can see an example of what I'm doing here http://colorgenetics.info/equine/foal-coat-color-calculator Right now, this page is actually an html form within a Drupal node. The results page is not within drupal at all only styled to look like Drupal.
I figure that the select form elements could be preoccupied with taxonomy terms, but I cannot see how a form could have its own term.
Do you perhaps mean that the resultpage is a term?
Again a form is no content even on your site.
This form I'm filling right now is a reply form, but it is not a reaction until I post this.
No, I want the form itself to be categorized. So that if I go to http://colorgenetics.info/equine the equine calculator will show up in the list along with all nodes that are tagged with the equine taxonomy and if I go to http://colorgenetics.info/canine the canine calculator will show up in the list along with all the nodes that are tagged with the canine taxonomy etc. The results being tagged isn't nearly as important.
If I must I can leave the form as html inside a node and parse the results with a module but that just seems a little patched together to me.
Comments
It is not clear what the
It is not clear what the purpose of the form is or what you mean by "assign this form to a taxonomy"
I want to tag it with a
I want to tag it with a taxonomy like you can a node. So it will show up on in the taxonomy page.
Do you mean tag the form?
Do you mean tag the form? That does not really make sense since the form is not content.
Do you want to save a term on
Do you want to save a term on form submit?
If so, create a custom submit callback in your module and in this callback you can use the function
taxonomy_term_save($term);.Where $term is an object containing at least the name you want to save and the vid (vocabulary) you want the term saved to.
The nice thing about this is that the saved $term will be return, so you can use the term id for further coding purposes. When you catch the results in a variable (
$result = taxonomy_term_save($term);) the variable $result will contain a TRUE or FALSE based upon the succes of the save action.Do you want to save a term on
Do you want to save a term on form submit?
No I want to assign a taxonomy tag to a page created by this function
Forms might not be considered content within drupal but my forms are content on my site and they need to be categorized as such. I will eventually have one for each taxonomy on the site. You can see an example of what I'm doing here http://colorgenetics.info/equine/foal-coat-color-calculator Right now, this page is actually an html form within a Drupal node. The results page is not within drupal at all only styled to look like Drupal.
I figure that the select form
I figure that the select form elements could be preoccupied with taxonomy terms, but I cannot see how a form could have its own term.
Do you perhaps mean that the resultpage is a term?
Again a form is no content even on your site.
This form I'm filling right now is a reply form, but it is not a reaction until I post this.
No, I want the form itself to
No, I want the form itself to be categorized. So that if I go to http://colorgenetics.info/equine the equine calculator will show up in the list along with all nodes that are tagged with the equine taxonomy and if I go to http://colorgenetics.info/canine the canine calculator will show up in the list along with all the nodes that are tagged with the canine taxonomy etc. The results being tagged isn't nearly as important.
If I must I can leave the form as html inside a node and parse the results with a module but that just seems a little patched together to me.