I'm using the channel entries search parameter to filter entries based on the value in a segment. However, I've just spotted that some of these segments contain ampersands, and these don't work correctly when filtering channel entries in this way. Is there a way around this?
Here's an example URL that I'm having issues with: mywebsite.com/regions/Yorkshire & Humberside
The spaces work fine as they are automatically converted into %20, like this: mywebsite.com/regions/Yorkshire%20&%20Humberside, which seems to work fine in EE. But the ampersand doesn't get converted into anything, so my segment is being ignored after the ampersand, so my filtering isn't working correctly.
I've tried changing the ampersand to %26, like this: mywebsite.com/regions/Yorkshire%20%26%20Humberside but that doesn't make any difference. I've also tried changing the ampersand to & amp; (I've added a space here as EESE keeps converting this into an ampersand if I write it out correctly) like this: mywebsite.com/regions/Yorkshire%20& amp;%20Humberside, but that just gave me the following error: The URI you submitted has disallowed characters.
Here's what my channel entries tag looks like:
{exp:channel:entries channel="location" status="open" limit="1000" dynamic="no" search:cf_location_region="{segment_2}"}
Can anyone think of any workarounds to this? I can't use categories due to the way in which I'm getting the data from an external data source. Thanks.