This patch allows the user to configure the case that pathauto uses for each substitution.
Putting in a placeholder as all lowercase (eg, [title]) results in the value being converted to lowercase; putting in the placeholder as uppercase (eg, [TITLE]) results in the value being uppercase, and using mixed case (eg, [Title] or [titLE] etc) results in the original case being used.
For example, having a path like:
[Vocab]/[catpath]/[FIELD_SKU]
results in:
Products/gloves/mittens/WLMITLGYEL
The rationale behind this is I was basically doing the above, using the SKU as a path component, however, it defaulted to being lowercase which doesn't look quite right.
Of course if implemented on a site already using pathauto, it defaults to using lowercase conversion just like it always has.
| Comment | File | Size | Author |
|---|---|---|---|
| pathauto.module_16.patch | 2.73 KB | gregmac |
Comments
Comment #1
cwgordon7 commentedI think this is a good idea, but it has been posted the wrong module. It should either be in the pathauto issue queue or the token issue queue. I am moving it now. As your patch applies to the pathauto module, I am moving it there. I am not sure what version you are referring to, so if I categorize it wrongly, I apologize.
-cwgordon7
Comment #2
gregglesThis is a very interesting idea.
This patch needs some help to get it to follow the code standards, but I do like the idea. See the coder module http://drupal.org/project/coder and the coding standards http://drupal.org/coding-standards for some details. In particular your help text is formatted in an abnormal manner and does not use the t() localization system.
Also, this patch is against the 5.x-1.x branch of the module which is closed for features. Can you update it to the 5.x-2.x branch?
The 5.x-2 branch already has a radio button that will leave case alone or lower case everything, so your patch should also remove that. Finally, this may not even be possible in 5.x-2 because of the token system. I'm not sure how strtr will handle this.
Comment #3
dave reidIt's probably more likely we could use something like [title:ucfirst] (upper-case first) or [title:ucall] (upper-case all). How the heck would [TitLE] work with a node title like 'This is a completely random node title.'. This would need to be added in Token or the Core D7 Token system.
Comment #4
dave reidMarking as postponed and for D7 since this wouldn't be possible with the D6 implementation.
Comment #5
dave reidI don't know how we can do this, so marking as won't fix.
Comment #6
Drupa1ish commentedFor pathauto at admin/config/search/path/settings we have Character case: change to lower case
Comment #7
nithinkolekar commentedboom :)
https://www.drupal.org/project/token_modifier