Reputation: 2617
When adding a taxonomy term in Drupal, it redirects back to itself to add another term. Is there a way of overriding this?
I have so far tried:
• Adding ?destination=_ to the page that links to the /add/term/ page
• Tried hook_taxonomy:
function modulename_taxonomy($op, $type, $array = NULL) {
if ($type == 'term' && ($op == 'insert' || $op == 'update') && $array['parent'][39] == 39) {
drupal_goto('page.html');
}
}
If instead of drupal_goto()
I put die('Here');
it outputs, but the drupal_goto()
does not work?
Upvotes: 2
Views: 545
Reputation: 31675
Implement hook_form_FORM_ID_alter
one of the following ways.
$form['#redirect']
entry.$form['#submit']
. That callback receives the $form
array and the &$form_state
array reference. Set the $form_state['redirect']
entry to he path that you want to redirect to.Upvotes: 5
Reputation: 1527
You can use rules module, and i'm sure you can create an action to redirect to an URL.
Upvotes: 0