Closed (won't fix)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 May 2012 at 22:26 UTC
Updated:
26 May 2012 at 15:13 UTC
I'm not quite sure if this is the correct place to post about this issue, but I gotta start somewhere.
What I'm trying to make is a page that has products/%product/images URL. So I tried the following:
1) Create page
2) Set Argument: Taxonomy term: ID
3) Change Argument type to: Term name and checked "Inject hierarchy into breadcrumb trail" & Transform dashes in URL to spaces in term name filter values
To make myself clear, here's an example and what happens with the url:
Product called: "Som' product & test:ing"
URL: products/som%27-product-%26-test%3Aing/images
Why doesn't it encode/remove these?
Sorry if this is any kind of duplicate but I couldn't find this anywhere. Thanks in advance!
Comments
Comment #1
merlinofchaos commented'these'
What do you mean by these?
Comment #2
ifish commentedThese: %26, %27 etc. I'm not sure what these are called.
Comment #3
ifish commentedif there is some quick fix/edit I could do in the code I'd be really thankful.
Comment #4
merlinofchaos commentedThose are HTML entities. Since you're doing a lookup on the term name, you can't really strip them out and expect the lookup to still work.
The best way to do this would be to use a Computed Field on your entity and write a small bit of PHP to strip out anything you don't want and make a "URL safe" field that you can then use for lookups like that.
You might ask why pathauto doesn't work that way, and it's because it actually more or less does -- but instead of being a field, there's a lookup table that says something like:
URL "foo/bar/baz" translates to "node/1"
You can't strip encoding on the fly and expect the lookups to work.
Comment #5
ifish commentedThanks for your reply but can you please clarify this?:
The best way to do this would be to use a Computed Field on your entity and write a small bit of PHP to strip out anything you don't want and make a "URL safe" field that you can then use for lookups like that.
--
Is there any kind of documentation/help for this? I've been struggling with that problem for a long time with drupal to have:
product/name
product/name/images
product/name/videos
Thanks in advance.
Comment #6
merlinofchaos commentedSorry, nothing I know of. I find it odd that there isn't more out there about doing this. It's a common need but it doesn't seem to be very commonly implemented.