Drupal 6 - Redirect after add taxonomy term
When adding a taxonomy term in Drupal, it redirects back to itself to add another term. Is there a way of over开发者_运维问答riding 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?
Implement hook_form_FORM_ID_alter
one of the following ways.
- If you know in advance where you would like to be redirected, change the
$form['#redirect']
entry. - If you only know after submission where would like to be redirected, add an additional callback to
$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.
You can use rules module, and i'm sure you can create an action to redirect to an URL.
精彩评论