How can I remove or rewrite "group/node" and "og_user_node" from url when user click on OG subscribe link ?
siteURL/group/node/63/subscribe/og_user_node
Is there any module like pathauto where I can use to make this url a custom look?
Thanks.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityHow can I remove or rewrite "group/node" and "og_user_node" from url when user click on OG subscribe link ?
siteURL/group/node/63/subscribe/og_user_node
Is there any module like pathauto where I can use to make this url a custom look?
Thanks.
Well you know that all these requests are made using hook_menu.
Yes, you should use hook_menu_alter Create new module and add hook_menu_alter
function my_module_menu_alter(&$items) {
// Unset core path
unset($items['The_actual_menu_request']);
$items['your_new_menu_request'] = array(
'title' => 'OG subscribe',
...
);
}
Just pass the same page callback and arguments as the menu request for og subscribe
EDIT
Well try this snippet and see if it works, for OG subscribe menu request
Create a custom module. If you do not know how to create a custom module read This
then in your .module file add this code. It should work, I do not know if the 'file' argument needs an absolute path to the file, but if it does not work you just have to change it for the real path in og '../og/og_ui/og_ui.pages.inc'
function my_module_menu_alter(&$items){
//unset core path
unset($items['group/%/%/subscribe']);
//as an example (taking the example url you provided) I will call the new menu request community/node/63/sign-in
$items['community/%/%/sign-in'] = array(
'type' => MENU_CALLBACK,
'file' => 'og_ui.pages.inc',
'page callback' => 'og_ui_subscribe',
'page arguments' => array(1, 2),
'access callback' => 'user_is_logged_in',
'title' => 'Join group'
);
}
Greetings hope it helps you, do not forget to mark the answer.