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?
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. 您可以使用规则模块,而且我确定您可以创建一个操作来重定向到URL。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.