1 node_example.module _node_example_installed_fields()

Define the fields for our content type.

This big array is factored into this function for readability.

Return value

array: An associative array specifying the fields we wish to add to our new node type.

Related topics

File

modules/examples/node_example/node_example.module, line 248
Module file for Node Example module.

Code

function _node_example_installed_fields() {
  return array(
    'node_example_color' => array(
      'field_name' => 'node_example_color',
      'cardinality' => 3,
      'type' => 'text',
      'settings' => array(
        'max_length' => 60,
      ),
    ),
    'node_example_quantity' => array(
      'field_name' => 'node_example_quantity',
      'cardinality' => 1,
      'type' => 'text',
    ),
    'node_example_image' => array(
      'field_name' => 'node_example_image',
      'type' => 'image',
      'cardinality' => 1,
    ),
  );
}