Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2009 at 14:38 UTC
Updated:
5 Aug 2010 at 22:10 UTC
I have an argument in Views that has a dash in it (7-11). Views (or php) is replacing the dash with a space (7 11). Is there a way to keep the dash in there?
Comments
Comment #1
traviscarden commented[Comment removed to #672606: Hyphens and forward slashes (-/) break Views contextual filters] (Sorry; I read this issue too fast.)
Comment #2
traviscarden commentedericinwisconsin, when you say the dash is being replaced with a space, do you mean in the path generated by a summary when the argument isn't present, or in the page title or breadcrumb when viewing that path?
Comment #3
ericinwisconsin commentedThis is probably too much info, but here I go...
I have a website dedicated to old magazines. I'm using the insert view module to insert a view into a node. To do this, I have to include some arguments, including the magazine title (7-11) and the name of the publisher (in this case, unknown). This will show all of the issues of 7-11 I have on the site. I just have to put this into the body of the node:
[view:matrix_mag=page_6=unknown,7-11]
That inserts the proper view into the node. Or at least, it WOULD insert it, if it weren't for that pesky dash. The dash gets stripped out and it looks for all magazines named "7 11", not "7-11", which means that no magazines are shown. I can work around this by just naming the magazines "7 11" instead of "7-11". No big deal. But IS there a way to include that dash?
Comment #4
traviscarden commentedMy first thought is that I wonder if you would have better success with the Views attach module, which accomplishes largely the same thing, but without you having to manually specify arguments--it can take them from node tokens and such. But secondly, I wonder if it would make it easier for you to specify the node ID (nid) to the magazines instead of their titles in your argument. That way there's no special characters problem, and you can even rename the mags down the line without breaking your Views. Hopefully this helps!
Comment #5
stefanhapper commentedNot sure if this addresses completely your problem, but maybe for others: Try turning off the option "Transform spaces to dashes in URL" in the views arguments settings for that field
Comment #6
esmerel commented