Discussion:
Override 'Size of textfield'
(too old to reply)
Muzaffer Tolga Ozses
2015-02-22 17:38:10 UTC
Permalink
Hi,

I wrote a module, which utilises field_create_field and
field_create_instance. I have my $instance array like below:

$instance = array(
'field_name' => 'field_tckn',
'entity_type' => 'user',
'bundle' => 'user',
'label' => t('TCKN'),
'description' => t('Enter your TCKN.'),
'settings' => array(
'user_register_form' => TRUE,
),
'display' => array(
'default' => array(
'label' => 'above',
'type' => 'text_textfield',
'settings' => array(
'size' => 11,
),
),
'full' => array(
'label' => 'above',
'type' => 'text_textfield',
'settings' => array(
'size' => array(
'#default_value' => 11,
),
),
),
),
'widget' => array(
'settings' => array(
'size' => 11,
'description' => t('Enter your TCKN.'),
),
),
);

The field is attaches to user bundle just fine, but what I would like to is
re-use the field in any content type. I can do that too, but I would like
to override 'Size of textfield' when I add the field. What am I missing in
the above code?

Regards,
--
mto
Continue reading on narkive:
Loading...