Enable fields in manage display programmatically D7 I have just started to use Drupal and I'm trying to add programmatically field in the .install file. 

 $field = array(
   'field_name' =&gt; 'title',
   'cardinality' =&gt; 1,
   'type' =&gt; 'text',
   'settings'    =&gt; array(
     'max_length' =&gt; 1024,
   ),
 );

 field_create_field($field);


 $instance = array(
   'field_name'  =&gt; 'title',
   'label' =&gt; $t('Title'),
   'type' =&gt; 'text',
   'widget' =&gt; array(
     'type'    =&gt; 'text_textfield',
     'weight' =&gt; 1.0,
    ),
   'display' =&gt; array(
     'default' =&gt; array(
       'label' =&gt; $t('label'),
       'type' =&gt; 'text',
      ),
    ),
 );

$instance['entity_type'] = 'node';
$instance['bundle'] = 'mytype';
field_create_instance($instance);


The field is added correctly but it is disabled in the Manage Display. How can I change the region column from 'disabled' to 'content'? I tried to add 'region' => 'content' in the instance array but it is not working and I cannot find a good example or documentation about the problem.

Thanks.
I couldn't find any concrete documentation either. However, I'm going out on a limb here and not 100% certain but, I think you just need to specify a correct formatter and the settings since it works that way in the UI.

$instance = array(
   'field_name'  =&gt; 'title',
   'label' =&gt; $t('Title'),
   'type' =&gt; 'text',
   'widget' =&gt; array(
     'type'    =&gt; 'text_textfield',
     'weight' =&gt; 1.0,
    ),
   'display' =&gt; array(
     'default' =&gt; array(
       'label' =&gt; $t('label'),
       'type' =&gt; 'text', // &lt;-- invalid formatter
      ),
    ),
 );


text is not a valid formatter type. It should either be text_default or text_plain or text_trimmed or text_summary_or_trimmed or hidden (which hides the field from display).