Currently, realname does not ingrate with Views' "Override title" option on contextual filters.

More Detail

When creating a view with a 'User: Uid' contextual filter, it is common to use the 'Override title' option so that the view title changes with the context. For example, you may want a view to be titled "John's Favorites" for when the contextual filter is passed user John's uid.

It would be great if this worked with realname. It currently shows the user's real user name rather than their realname.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grasmash’s picture

Status: Active » Needs review
FileSize
2.46 KB

Attaching patch to support this.

It was necessary to create a new views handler class, add it to the files[] array in realname.info, and expose it via hook_views_data_alter().

grasmash’s picture

One thought-- we may want to make this override optional by modifying options_form() in the views handler. I'd be happy to make this change if 1) you'd actually like to commit this feature, and 2) you think the option is a good idea.

grasmash’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev

Changing version. The patch was rolled against 7.x-1.x from git repo.

kaztur’s picture

#1 works for me.

Great Thanks, madmatter23!

Thousand pities that this code doesn't put the same profit for 'User posted or commented' and 'Comment: Author uid' contextual filters! :(

phiscock’s picture

Thanks. That patch worked perfectly and did just what I needed. Hopefully it can be committed soon.

jgullstr’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Works as expected. Thanks!

mplewis’s picture

Is anyone able to tell me how to use this feature? How do I make %1 output the realname instead of the stock user name? Was this patch rolled into 7.x-1.2? Thanks!

hass’s picture

lomsdalen’s picture

Hass, not really. I would say that they are totally different...

hass’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Please add tests so we can verifiy this works and it never breaks.