php - In Drupal how to get tnid or the node id of the translated node? -
i need access id of translated node, if available given node. nid node id. seem tnid id of translated node. however, seem not case. how can id? tried following code, did not work.
global $language; $translations = translation_node_get_translations($node->tnid); if ($translations[$language->language]) { $tnode = node_load($translations[$language->language]->nid); echo $tnode->nid; }
any suggestions?
i need tnid create custom translation-link. thanks.
translation_node_get_translations($node->tnid);
provides array of corresponding language nodes. did not realize it, that's needed.
Comments
Post a Comment