|
@@ -4,7 +4,7 @@ In summary, creation of a new field requires creation of three classes that inhe
|
|
|
|
|
|
The hook_bundle_field_info() function
|
|
|
-------------------------------------
|
|
|
- The three TripalField classes simply define how the field will function, but Drupal does not yet know about the field. The ``hook_bundle_field_info`` function tells Drupal about your field. It must be implemented in a custom Drupal module,and provides an array that tells Drupal about the fields and the classes to use for the field. Suppose we were creating a field named ``obi__genus`` which displays the Genus for a species and we have a custom module named ``tripal_org2``. The hook function would be named ``tripal_org2_bundle_field_info()``:
|
|
|
+ The three TripalField classes simply define how the field will function, but Drupal does not yet know about the field. The ``hook_bundle_field_info`` function tells Drupal about your field. It must be implemented in a custom Drupal module, and provides an array that tells Drupal about the fields and the classes to use for the field. Suppose we were creating a field named ``obi__genus`` which displays the Genus for a species and we have a custom module named ``tripal_org2``. The hook function would be named ``tripal_org2_bundle_field_info()``:
|
|
|
|
|
|
.. code-block:: php
|
|
|
:linenos:
|
|
@@ -217,4 +217,4 @@ The following code is a snippet from the ``tripal_chado_bundle_create_user_field
|
|
|
|
|
|
It is possible to have a field that is both programmtically attached to some content types but is also allowed to be attached to another content type by the site admin using the web interface. To do this, programmatically add the field to the content types using the ``hook_bundle_instance_info`` function and also implement the ``hook_bundle_create_user_field`` function to support manual adding.
|
|
|
|
|
|
-
|
|
|
+
|