This should be easy to do, but its very hard to Google.
Within the admin and surrounding workflows, various links point to user/foobar. I have a different page to display users, say /faces/xx. I want to intercept (or rewrite) every url linking to user/foobar/ to faces/xx.
Pathauto lets you customize what paths user profiles have. If I set that to /faces/[user:uid], it will create aliases overriding my module router; so that faces/xx looks the same as user/foobar previously did. That is not what I want.
You can redirect users on login or other triggers. That is also not what I am looking for.
Most likely, I can override something in my module that intercepts user/foobar calls and does a drupal_goto('faces/xx')
. Or there is a url_alter that I can override that writes out the user/foobar links. That, or something similar, is what Im looking for.
EDIT -- sample code from the module that generates the faces page
function faces_menu() {
$items = array();
$items['faces/%'] = array(
'title' => t('Face'),
'access callback' => true, // more complex in reality
'page callback' => 'faces_page',
'page arguments' => array(1,2),
'type' => MENU_CALLBACK,
);
return $items;
}
function faces_page($uid) {
global $user;
$output = array(
'faces-page' => array(
'magic' => voodoo($uid),
'#theme' => 'faces_pages'
)
);
return $output;
}
and ofcourse theres a faces_theme() to match it.
hook_url_inbound_alter()
user/[username]
and I want to link tofaces/[uid]
; so I would have to resolve [username], probably with urlencoding, to [uid]