カスタム フィールド プラグインがあります。ウィジェットは次のようになります。
function mymodule_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
...
$main_widget = $element + array(
'#test' => 'test',
'#type' => 'textarea',
'#attributes' => array('item_capacity' => 3),
'#theme'=>'mymodule_theme'
);
...
}
現在のノードに関連付けられている別のフィールドの値を取得し、それをこのウィジェットのテーマ ファイルに渡す必要があります。hook_field_widget_form() から現在のフィールドを含むノードの ID を取得できますか?