Currently I need to use following code:
/**
* Implements hook_views_post_execute().
*/
function example_views_post_render($view, &$output, &$cache) {
if (arg(0) == 'crm' && arg(1) == 'contact' && arg(2) != '' ) {
$contact = crm_core_contact_load(arg(2));
$view->set_title(t(crm_core_contact_title($contact)));
}
}
This happens because it is not possible to do the same in Views. When clicking on "Override title" and embedding there "%1" we are having id instead of contact name.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Override Title #2.png | 116.3 KB | pdcrane |
| #2 | Override Title #1.png | 113.6 KB | pdcrane |
Comments
Comment #1
Anonymous (not verified) commentedYeah, this is really a limitation of views more than anything. Addressed in CRM Core through some preprocessing functions.
Comment #2
pdcrane commentedJust for those looking for a similar solution. I implemented this using the Views UI on a view with contextual filters (a views replacement for crm-core/contact/%1/view)
In Views 3:
Do not include
tags