Created
February 10, 2016 10:03
-
-
Save vincenzodibiaggio/c688812b84e9a8c07e31 to your computer and use it in GitHub Desktop.
Drupal 7 - Add a textarea to custom variables edit form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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