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".

CommentFileSizeAuthor
#8 interdiff-6-8.txt740 bytesrecrit
#8 1196058-provide-additional-rewrite-options-tolower-punctuation-8.patch13.53 KBrecrit
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: tests were executed, but no results were found. View
#6 1196058-provide-additional-rewrite-options-tolower-punctuation-6.patch13.53 KBmukhsim
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

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

Issue summary: View changes
FileSize
13.53 KB
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es). View

Attached patch provides to_lowercase and replace_punctuation options.

mukhsim’s picture

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

FileSize
13.53 KB
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: tests were executed, but no results were found. View
740 bytes

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

Status: Needs review » Needs work