summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/taxonomy/views_handler_field_taxonomy.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/taxonomy/views_handler_field_taxonomy.inc b/modules/taxonomy/views_handler_field_taxonomy.inc
index ed9ac97..0093b04 100644
--- a/modules/taxonomy/views_handler_field_taxonomy.inc
+++ b/modules/taxonomy/views_handler_field_taxonomy.inc
@@ -20,6 +20,7 @@ class views_handler_field_taxonomy extends views_handler_field {
function option_definition() {
$options = parent::option_definition();
$options['link_to_taxonomy'] = array('default' => FALSE);
+ $options['convert_spaces'] = array('default' => FALSE);
return $options;
}
@@ -34,6 +35,12 @@ class views_handler_field_taxonomy extends views_handler_field {
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_taxonomy']),
);
+ $form['convert_spaces'] = array(
+ '#title' => t('Convert spaces in term names to hyphens'),
+ '#description' => t('This allows links to work with Views taxonomy term arguments.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['convert_spaces']),
+ );
}
/**
@@ -50,6 +57,11 @@ class views_handler_field_taxonomy extends views_handler_field {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = taxonomy_term_path($term);
}
+
+ if (!empty($this->options['convert_spaces'])) {
+ $data = str_replace(' ', '-', $data);
+ }
+
return $data;
}