It would be nice to be able to replace the ampersand (&) with the word 'and' such that, for example, a page "Cats & Dogs" translated to www.example.com/cats-and-dogs rather than www.example.com/cats--dogs or something similar. That would be a more meaningful replacement which would preserve the "interpret-ability" of the resulting URL. (Thanks for the great module!)

Comments

greggles’s picture

Version: 6.x-1.1 » 7.x-1.x-dev

I don't think this should be in Pathauto itself and rather chould be done on a per site basis via something like #212208: allow other modules to affect strings (to help with custom accent/string replacement).

Freso’s picture

Status: Active » Closed (won't fix)

As Greg said, for 6.x-2.x, it will (hopefully) be possible to implement custom hooks to do such jobs. Until then (6.x-1.x and earlier), you can enable transliteration and add the line "& = and" to the i18n-ascii.txt file (and for 6.x-2.x, you should be able to add it to Transliteration's tables).

joshuajabbour’s picture

Just an update to alert other users that the instructions in #2 won't work.

"&" is a reserved character in .ini files (along with {}|~![()" and some php reserved words), so this isn't a possible solution. I've tried a few other ideas, but nothing has worked so far. The only solution AFAIK is patching the module to add support, which has been turned down by the maintainers before, so I don't think this is possible with Pathauto 1.x.

greggles’s picture

@joshua.jabbour - you mean that some of the instructions in #2 don't work.

I'm more confident that the 2.x branch can successfully use transliteration to do this.

Freso’s picture

Actually, if the transliteration is done after the character stripping, it might not work... I haven't looked at the code to see when it happens, so this might not be an issue. Just thought I ought to mention it. :)