Closed (duplicate)
Project:
Pathauto
Version:
5.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2007 at 08:48 UTC
Updated:
8 Oct 2007 at 10:07 UTC
Hi there,
Apologies if this issue has been discussed before, but I've not found any reference to it through searching.
I'm using the [menupath] option for generating node aliases for the pages on my site. One of the pages is titled "News & Events". Pathauto generates an alias for this page as [menupath]/news-%26-events/. Instead, I'd prefer it if the ampersand were stripped out completely, which would leave me with the alias of [menupath]/news-events/.
I've tried adding '&', '&', and '%26' to the "Strings to Remove" option under General Settings, but to no avail.
Is this possible?
Thanks!
Rob
Comments
Comment #1
HorsePunchKid commentedI think you've got the same problem that's being addressed here. There are some possible fixes in that discussion, but nothing final, I think.
Comment #2
robschmitt commentedThanks for you reply.
Waht I really wanted to know was whether I could manage it without having to hack the pathauto module. It seems like there is no other option though, so I've inserted a simple bit of code to replace ampersands in the pathauto_cleanstring function in pathauto.inc:
$output = str_replace('&', '', $output);
This has gone in on line 110 just before whitespace is replaced by the separator character.
Comment #3
gregglesI promise there will be a solution to this by the end of October. No need to hack then.
Comment #4
robschmitt commentedThat'd be brilliant, thanks!
I work for a British digital agency building (primarily) Drupal-based websites. Pathauto is one of the first modules I download when I begin a new site. Top work!