It would be great to have the option to hyphenate spaces in in Field Configuration options.

I am using Views to create SEO links (eg: sitename.com/state-name/city-name) from taxonomy term tokens. I do it this way: /[name]/[field_city_n]?tid=[tid] . These tokens are: term-parent & term-name.

Some taxonomy terms contain multi-word terms (eg: New South Wales). Pathauto converts the spaces to hyphens. Links generated for multiword terms 404. All that is missing is the hyphen - perhaps the pathauto behavior could mirrored in Views?

Perhaps the option to convert spaces to hyphens in my fields would be a good addition to Views? Doesn't seem too different from "Remove Whitespace" or "Strip HTML".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BarwonHack’s picture

Oh, and perhaps "Convert to lowercase" would also be nice?

cartagena’s picture

I'm also struggling with the same issue. Views is a great module, this is the first thing I haven't been able to figure out (not being a programmer) Thanks!

MrPaulDriver’s picture

Following the same principles it would also be most helpful to have Pathauto style treatment of punctuation and symbols. So that Paul's Bike & Skate Shop is rewritten as pauls-bike-skate-shop rather than paul%27s-bike-%26-skate-shop

Given that the requests above appear to have been implemented now, should I post this as a separate feature request?

carajito’s picture

pathauto inside option will be excellent solution.

As implemented by "File (Field) Paths"

moltra’s picture

I also would love the pathauto options in views.

mukhsim’s picture

Attached patch provides to_lowercase and replace_punctuation options.

mukhsim’s picture

Assigned: Unassigned » mukhsim
Status: Active » Needs review
recrit’s picture

Re-rolled patch to fix misspelling for "replace_punctuations" which should be "replace_punctuation".

Status: Needs review » Needs work
DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
13.3 KB

Rerolled.

DamienMcKenna’s picture

Status: Needs review » Needs work

This needs an update to views.api.php for the new hook, and I'd like the comment above the drupal_alter() to specifically say "Triggers hook_views_punctuation_chars_alter()."

DamienMcKenna’s picture

Assigned: mukhsim » Unassigned