function _content_slider_installed_instances in Featured Content Slider 7.3
Same name and namespace in other branches
- 7 content_slider.module \_content_slider_installed_instances()
- 7.2 content_slider.module \_content_slider_installed_instances()
Define the field instances for our content type.
The instance lets Drupal know which widget to use to allow the user to enter data and how to react in different view modes. We are going to display a page that uses a custom "content_slider_list" view mode. We will set a cardinality of three allowing our content type to give the user three color fields.
This big array is factored into this function for readability.
Return value
An associative array specifying the instances we wish to add to our new node type.
1 call to _content_slider_installed_instances()
- content_slider_node_type_insert in ./
content_slider.module - Implements hook_node_type_insert().
File
- ./
content_slider.module, line 254 - Module file for content slider module.
Code
function _content_slider_installed_instances() {
return array(
'field_slider_image' => array(
'field_name' => 'field_slider_image',
'label' => t('Upload an images'),
'required' => FALSE,
'widget' => array(
'type' => 'image_image',
'weight' => 2.1,
),
'display' => array(
'default' => array(
'label' => 'hidden',
'type' => 'image',
'module' => 'image',
'weight' => 1,
),
),
),
);
}