I recently worked on a project in Drupal that called for a large number of taxonomy terms. I needed to put the terms in a specific order, but unfortunately, I had more terms than Drupal's weight field supports, which is a range from -10 to +10.
I did a quick search on Drupal, and was horrified to see how many people are hacking core to add a greater range. This is pretty easy to do without hacking core. All you need to do is create your own module that implements hook_form_alter().
my_module.module
<?php
function my_module_form_alter($form_id, &$form) {
switch($form_id) {
case 'taxonomy_form_term':
$form['weight']['#delta'] = 100;
break;
}
}
?>And that's it!
[tags]alter, drupal, form, hook, module, taxonomy, term, weight[/tags]
Recent comments
3 weeks 5 days ago
8 weeks 1 day ago
8 weeks 1 day ago
2 years 6 days ago
2 years 1 week ago
2 years 22 weeks ago
2 years 22 weeks ago
2 years 29 weeks ago
2 years 39 weeks ago
2 years 11 weeks ago