So I have a module that adds a new field type to the database. The field consists of two things, a bonus category which is just the ID of a taxonomy term, and a bonus amount, which is an integer. Everything works fine, but I'd like to change the field entry form to something a little less default. I followed the code given in the poll module, and it seemed to me that I had to do three things:
1. Add (hook)_theme
2. Add template_preprocess_(some_name)
3. Add a template
The trouble I'm having is that template_preprocess is never called, so my template is never used. I suspect that I'm missing something, like how to tell Drupal that my widget is themed. Can you spot what I need? Here's my module info, code, and template:
category_bonus.info
name = Category Bonus
description = "Creates a custom field for entering and displying project bonus data for categories."
package = Fields
core = 7.x
files[] = category_bonus.module
php = 5.2
category_bonus.module:
<?php
/**
* @file
* A category bonus field using the Field API.
*
*/
/**
* Implements hook_theme().
*/
function category_bonus_theme() {
dpm("category_bonus_theme called");
return array(
'bonus_entry' => array(
'template' => 'bonus-entry',
'render element' => 'form'
)
);
}