function page_title_form_taxonomy_form_term_alter in Page Title 7.2
Same name and namespace in other branches
- 8.2 page_title.module \page_title_form_taxonomy_form_term_alter()
- 6.2 page_title.module \page_title_form_taxonomy_form_term_alter()
Implement hook_form_FORM_ID_alter().
File
- ./
page_title.module, line 248 - Enhanced control over the page title (in the head tag).
Code
function page_title_form_taxonomy_form_term_alter(&$form, $form_state) {
// If we dont have permission to set the title then we need to abort this alter now!
if (!user_access('set page title')) {
return;
}
// For some reason, the term delete confirm form is run through the taxonomy_form_term form - skip if this is case!
//if ($form['delete']['#value'] === TRUE) return;
// Check the term's vocab has the show field enabled
if (variable_get('page_title_vocab_' . $form['#vocabulary']->machine_name . '_showfield', 0)) {
$form['advanced']['page_title'] = array(
'#type' => 'textfield',
'#title' => t('Page title'),
'#description' => t('Provide a description of this term to appear in the <title> tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
'#default_value' => isset($form['tid']) ? page_title_load_title($form['tid']['#value'], 'term') : '',
'#size' => 60,
'#maxlength' => 255,
'#weight' => -20,
);
}
}