Skip to content

Instantly share code, notes, and snippets.

@vincenzodibiaggio
Created February 10, 2016 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincenzodibiaggio/c688812b84e9a8c07e31 to your computer and use it in GitHub Desktop.
Save vincenzodibiaggio/c688812b84e9a8c07e31 to your computer and use it in GitHub Desktop.
Drupal 7 - Add a textarea to custom variables edit form
/**
* Implements hook_variable_info().
*/
function your_module_variable_info($options) {
$variables['your_variable'] = array(
'title' => t('Title', array(), $options),
'description' => t('Description.', array(), $options),
'type' => 'text',
'default' => 'Default value',
'group' => 'my_variables_group',
'element' => array(
'#type' => 'text_format',
'#base_type' => 'textarea',
'#cardinality' => 1,
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment