You are here

function taxonomy_breadcrumb_form_taxonomy_form_vocabulary_alter in Taxonomy Breadcrumb 7

Same name and namespace in other branches
  1. 6 taxonomy_breadcrumb.module \taxonomy_breadcrumb_form_taxonomy_form_vocabulary_alter()

Implements hook_form_FORM_ID_alter().

File

./taxonomy_breadcrumb.module, line 132
The taxonomy_breadcrumb module generates taxonomy based breadcrumbs on node pages and taxonomy/term pages. The breadcrumb trail takes on the form: [HOME] >> [VOCABULARY] >> TERM >> [TERM] ...

Code

function taxonomy_breadcrumb_form_taxonomy_form_vocabulary_alter(&$form, &$form_state) {

  // Do not alter on deletion.
  if (isset($form_state['confirm_delete']) && isset($form_state['values']['vid'])) {
    return;
  }

  // Include the .inc file with all helper functions.
  module_load_include('inc', 'taxonomy_breadcrumb', 'taxonomy_breadcrumb.admin');
  module_load_include('inc', 'taxonomy_breadcrumb');
  $form['taxonomy_breadcrumb_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Breadcrumb path (taxonomy_breadcrumb)'),
    '#default_value' => isset($form['vid']['#value']) ? _taxonomy_breadcrumb_get_vocabulary_path($form['vid']['#value']) : '',
    '#maxlength' => 128,
    '#description' => t("Specify the path this vocabulary links to as a breadcrumb. If blank, the breadcrumb will not appear. Use a relative path and don't add a trailing slash. For example: node/42 or my/path/alias."),
    '#weight' => 0,
  );
}