Skip to content

Instantly share code, notes, and snippets.

@vishnukumarpv
Last active July 24, 2019 12:26
Show Gist options
  • Save vishnukumarpv/c23ed70734473f75b6a8251675a0d1e9 to your computer and use it in GitHub Desktop.
Save vishnukumarpv/c23ed70734473f75b6a8251675a0d1e9 to your computer and use it in GitHub Desktop.
module configuration form Drupal 7
function HOOK_menu(){
$items = [];
$items['admin/config/content/HOOK_custom'] = array(
'title' => 'Meta tags',
'description' => 'Configuration for Meta tags module',
'page callback' => 'drupal_get_form',
'page arguments' => array('HOOK_custom_form'),
'access arguments' => array('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
function HOOK_custom_form($form, &$form_state) {
$form['HOOK_custom_meta_desc'] = array(
'#type' => 'textarea',
'#title' => t('Meta tag: Description'),
'#default_value' => variable_get('HOOK_custom_meta_desc', ""),
'#description' => t('Meata description for home page'),
'#required' => FALSE,
);
return system_settings_form($form);
}
name = Custom
description =
core = 7.x
package = TNM Custom
configure = admin/config/content/HOOK_custom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment