我使用自定义格式化程序(Drupal,CCK)创建了一个字段。
现在我得到了这个 PHP 代码来导出
/**
* Implements hook_theme().
*/
function product_attribute_theme() {
return array(
'product_attribute_formatter_product_attribute' => array(
'arguments' => array('element' => NULL),
),
);
}
/**
* Implements hook_field_formatter_info().
*/
function product_attribute_field_formatter_info() {
return array(
'product_attribute' => array(
'label' => 'Product Attribute',
'description' => t('an Attribute of a Product'),
'field types' => array('content_taxonomy', 'text'),
'multiple values' => CONTENT_HANDLE_MODULE,
),
);
}
function theme_product_attribute_formatter_product_attribute($element) {
return ($element['#item']['value']);
}
我试图将它作为一个模块添加到 CCK 中,但它没有将它添加到字段中,我该怎么做?