How to convert hyphens to spaces in URL?

aaron - July 24, 2009 - 18:43
Project:Chaos tool suite
Version:6.x-1.0-rc1
Component:Code
Category:feature request
Priority:normal
Assigned:aaron
Status:needs work
Description

When creating a context (in this case by taxonomy term name), I'd like to have the same functionality as with Views 2, which allows one to convert hyphens to spaces. Thus you can have http://example.com/mypanel/blue-sky rather than "http://example.com/mypanel/blue sky" or "http://example.com/mypanel/blue+sky".

However, I do not see an option for this. Am I being blind? Or would this be a feature request?

#1

merlinofchaos - July 24, 2009 - 23:12
Category:support request» feature request

This would probably need a custom argument handler or something similar.

#2

aaron - August 20, 2009 - 20:47
Assigned to:Anonymous» aaron

well, this is becoming a bit of a blocker for my particular use case, so i'm going to dig into this now.

#3

aaron - August 20, 2009 - 21:07

here's the form stuff -- still trying to figure out what to do with $conf once we collect it...

AttachmentSize
space_to_hyphen-530174-3.diff 2.7 KB

#4

aaron - August 20, 2009 - 21:12
Status:active» needs work

#5

aaron - August 20, 2009 - 21:25

this one should work, but it doesn't. what am i doing wrong?

AttachmentSize
space_to_hyphen-530174-4.diff 3.17 KB

#6

aaron - August 20, 2009 - 21:38
Status:needs work» needs review

ok, this should work as advertised now...

AttachmentSize
space_to_hyphen-530174-6.diff 3.23 KB

#7

petrelharp - September 5, 2009 - 18:35

Awesome. It works for me. Thanks a bunch.

#8

merlinofchaos - October 1, 2009 - 22:47
Status:needs review» needs work

Ok, here's what I want for this to go in:

Taxonomy term name should be split out from Taxonomy term ID argument. However, it needs to be done in such a way that older configurations will still work; so the original argument should still be able to accept a term ID. Possibly the easiest way to do that is to introduce tid.inc and term_name.inc and deprecate term.inc entirely but leave it so that it can still be used. It'd be even better if we introduce a way to remove it from the UI but still have it in the background That can come later.

Then, taxonomy term name can have an option to translate dashes to spaces.

And the new user name argument should have the same support.

 
 

Drupal is a registered trademark of Dries Buytaert.