• Avail guidance to develop Drupal modules & Drupal themes
  • Share and get review of your code
  • Get Access to free CodeBooks and ThemeBooks
  • Drupal 5, 6 and 7 covered

Userpoints Meter

0 Points /1000 Points

Automatic redirection to node translation form

in Project codes

This CodeLet will redirect you to the translation form of a node after you have created a node. Make sure you have selected a language and not "Language neutral" when saving the node.

<?php
//$Id$

/**
* @file
*
* Redirect to translation form of a node
*
* @author Bhavin Joshi <http://twitter.com/bhavinhjoshi>
*/


function autotranslate_node_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
    switch (
$op) {
        case
'insert':
           
drupal_goto("node/add/page", "translation=". $node->nid ."&language=gu");
            break;
    }  
}
?>

5
Your rating: None Average: 5 (3 votes)

Comments

joshi's picture
5

This is working for me. I have created an admin interface to proiritize the redirection to next language and it works like a charm!
Thanks for this CodeLet.

[url=http://joshics.in]JoshicsIN[/url]

beautifulmind's picture
5

I would rather choose to redirect the user to his/her interface language after the node is created in a different language.
I believe I just have to use $user object and use the languge data of the user.

Btw. thanks for the CodeLet. It really works.

Regards.

DrupalD's picture
5

You can even create an admin interface using which you can configure the options such that you will see the form one by one for each language. All you need to do is to queue that languages with your admin interface and retrive the quie upon node creation.

Regards.

[url=http://twitter.com/DrupalD][i]Drupa Developer - A Comprehensive Guild to Drupal Developersl[/i][/url]

Syndicate content

Recent comments