You are here

content_slider.install in Featured Content Slider 7

Same filename and directory in other branches
  1. 7.3 content_slider.install
  2. 7.2 content_slider.install

Install, update and uninstall functions for the field module.

File

content_slider.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the field module.
 */

/*
* Implements hook_enable()

function content_slider_enable(){
    # Use me. Otherwise, I won't work because I don't know your custom defined fields ]:->
    field_cache_clear();
	field_associate_fields('content_slider');
	// Check if our field is not already created.
    if (!field_info_field('field_sliderimage')) {
      $field = array(
        'field_name' => 'field_sliderimage',
        'type' => 'image',
      );
    field_create_field($field);
	
	// Create the instance on the bundle.
    $instance = array(
        'field_name' => 'field_sliderimage',
        'entity_type' => 'node',
		'bundle' => 'content_slider',
        'label' => 'Slider Images',
        'required' => TRUE,
        'widget' => array(
            'type' => 'image_image',
        ),
      );
     field_create_instance($instance);
   }
}
*/