FALSE); return $options; } /** * Provide link to taxonomy option */ function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $form['link_to_taxonomy'] = array( '#title' => t('Link this field to its taxonomy term page'), '#description' => t('This will override any other link you have set.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_taxonomy']), ); } /** * Helper function to render a specific term. Handles the term link. */ function render_term($tid, $values) { if (empty($this->api_terms)) { $tree = project_release_get_api_taxonomy(); foreach ($tree as $term) { $this->api_terms[$term->tid] = $term; } } $current_term = $this->api_terms[$tid]; if (!empty($this->options['link_to_taxonomy'])) { $this->options['alter']['make_link'] = TRUE; $this->options['alter']['path'] = taxonomy_term_path($current_term); } return check_plain($current_term->name); } function render($values) { return $this->render_term($values->{$this->field_alias}, $values); } }