J'ai créé un champ en utilisant Custom Formatters (Drupal, CCK).
Maintenant, j'obtenu ce code PHP pour exporterDes formateurs personnalisés à un champ?
/**
* 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']);
}
J'ai essayé de l'ajouter comme module CCK mais il n'a pas l'ajouter aux champs, comment puis-je faire?