I scoured the issue queue for a dup, but is this possible? The use case is this: I have a view that I want to display the themed realname and link it, not to the user's page, but to their blog page. This requires me to use the views "rewrite this field" option to do something like <a href="blogs/[(user)name]">[(real)name]</a>, where my alias to blog pages (core is blog/5) is to blogs/joesmith. So I want it to show the realname Joe Smith and the link be to the aliased path, which uses the core username. Can this be done with existing views integration or is this custom at this point? I'm sure it wouldn't be too hard to do manually, just not sure how to go about it. Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

At my last gig, we used Pathauto to to make "blogs/uid" point to "blogs/realname" and then "blogs/uid" always showed up with the name.

scotwith1t’s picture

hmmm...blogs are aliased like blogs/joesmith, but if i rewrite the views field to blog/5 it still takes me to blog/5 and not to the aliased path...note the 's' in the aliased path and no 's' in the core path...

NancyDru’s picture

Then it must have been Global Redirect that changed it for us.

scotwith1t’s picture

This is still a real thorn in my side, sorry. Would it be a huge change to make both available as views fields and do away with the checkbox in a new release or at least in dev? I wish I was strong enough in php to try this myself, but I'm just not. I now have at least 3 different ways I need this on a current site. The latest is a userreference field that's on a node type 'event', instead of showing that username I want to show their realname, but I need the unthemed username to rewrite a field to link directly to their contact page instead of their user page. If the unthemed name was available as well as realname themed, I could rewrite using <a href="/users/[unthemed]/contact">[themed]</a>. Does that make sense? As it is now, I get either <a href="/users/joesmith/contact">joesmith</a> when i uncheck the setting to override the username in views. the link works, but this displays the unthemed name. if i do <a href="/users/JOE SMITH/contact">JOE SMITH</a> the display is correct, but the link doesn't work...see what I mean? I can probably use global redirect as you suggested, but i think this would be a very useful feature to many.

derhasi’s picture

Status: Active » Needs review
Issue tags: +views, +join
FileSize
645 bytes

You have to switch off Overwrite user fields in view to show realnames on admin/user/realname and apply the patch below, as this makes the realname available for a node's author.

Status: Needs review » Needs work

The last submitted patch, realname-views-both-1130350-5.patch, failed testing.

derhasi’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Status: Needs work » Needs review
FileSize
505 bytes

Altered path in patch file and applied to current dev.

Status: Needs review » Needs work

The last submitted patch, realname-views-both-1130350-7.patch, failed testing.

derhasi’s picture

Status: Needs work » Needs review
fuzzy76’s picture

hass’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)