Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. node/42 = pathalias_de (german version)
  2. node/43 = pathalias_en (english version)
  3.  
  4. global $language;
  5. $translations = translation_path_get_translations("node/42");
  6. /*
  7. Returns the paths of all translations of a node, based on its Drupal path:
  8. array(2) {
  9. ["de"]=>string(7) "node/42"
  10. ["en"]=>string(7) "node/43"
  11. }
  12. */
  13. print l(t('Link Title'), $translations[$language->language]); //l() will return the alias to node/42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement