I should mention I use Pathauto, but I've set these aliases manually just to make sure there was no funny business going on with it.
I am trying to set up an Author/Blog list page. When I add User: Name as a Field, the link cannot be modified to NOT be the User's login Name.
As an example, I have a user with the user name John Smith and there are several path aliases set up for him:
/users/john_smith
/users/john_smith/tracker
/blogs/john_smith
/blogs/john_smith/feed
In Fields, when I try to "Rewrite the output of this field" or "Output this field as a link" or even "Link this field to its user," it will not change the User Name link from being:
http://mydomain.com/blogs/John Smith
(Yes, with a space in it -- John Smith is the actual user name.)
For Arguments I have : User: Name, and User: Uid
For Fields I have: Node: Has new content, and User: Name
For Filters I have: User: Active Yes, and Node: Type = Blog Post
No Relationships or Sort Criteria
In the user's profile page, there is a small link there called "View recent blog entries" that correctly
shows the link as:
http://mydomain.com/blogs/john_smith
Please patch this, or tell me how I've royally screwed up this view somehow. :-) Thanks.
~ G Piper
Comments
Comment #1
gregarios commentedOops, I forgot to give my specs too: FreeBSD 6.3, Drupal 6.10, MySQL 5.0.75, PHP 5.2.8, Apache 2.2.11, jQuery Update 1.2.6.
Comment #2
merlinofchaos commentedBecause aliases always convert to an id, you should definitely be using User: UID only, not User: Name at all.
Try that.
Comment #3
gregarios commentedI can get the links to show the correct path using
User: UIDlike you suggested. However, it only works if I don't haveUser: Nameas an argument NOR as a Field... and that means I cannot show the link itself as a Name. As soon as I disable theUser: Nameeverywhere, the UID paths show up correctly in the links. When I enable theUser: Nameanywhere, the path changes into the User Name like before -- no matter what I do it seems.As a possible solution:
In the Fields section of views, it would be REALLY helpful, and would provide a simple workaround for this problem, if "Transform spaces to dashes in URL" could have an option of using underscores instead of dashes. My Pathauto uses underscore as a substitute for spaces in pathnames, not dashes, and this would enable me to set up the real user name as an actual path that works. For me, "Transform spaces to underscores in URL" would be more preferable. (Since dashes don't work for me without re-making all the aliases on my entire 9000 node site)
Comment #4
gregarios commentedProblem still exists with version 6.x-2.5.
It seems that anytime I create an Argument to be a Sort Ascending or Descending list, the list overrides any further settings from Fields, Sort Criteria, and even Basic Settings Row Style. I can add as many Fields as I want after that, and they don't even show up.
Comment #5
esmerel commentedComment #6
suffering drupal commentedI have the same problem but instead of using username I'm using Taxonomy terms: [name]/[name_1]
Everything is working correctly except that the space between words remains a space in the link URL:
/en/Tourism/Monuments and buildings
while in the real URL's the space is substituted by a hyphen.
/en/tourism/monuments-and-buildings
How and where can we tell the view to substitute those spaces for hyphens in the output?
- can it be done under "Rewrite the output of this field"
- should we add additional PHP in the code of this view? Which file, what PHP?
- invent redirects from all taxonomy term URLs with spaces to taxonomy term URLs with hyphens? (allmost all...)
By the way in our case the link text does not break on the space as in the former case (gregarios). It's just that the link maintains the spaces in more-than-one-word taxonomy terms (and upper/lower case, by the way).
View settings:
Fields
Taxonomy:Vocabulary Name
Taxonomy: Term
Node: Nid
SQL Aggregation: Group By Fields
Fliters
Taxonomy: Vocabulary = Tourism
(some more)
Comment #7
suffering drupal commentedLooking at the code I get with export i find these frases:
'make_link' => 1,
'path' => '[name]/[name_1]',
could the latter one be told to substitute spaces for hyphens??
Comment #8
suffering drupal commentedSame problem being addressed at http://drupal.org/node/514078
Comment #9
suffering drupal commentedMerlin I have the same problem as Gregarios, see the additional comments below.
Is my information the "more info" you needed?
I am sure the solution must be something tremendously simple/stupid using some PHP substitution code for the spaces. But I am newbie (even after more than 2 years of desparing trial and error) and I just don't know.
Please inform.
Comment #10
dawehnerThis will be solved with #669636: Re-structure all links handlers to support advanced rendering of links