If you're using the
i18n module to translate a website's contents, and you need also to have a specific homepage for each language, here are a couple of ways to get it:
if you use a custom PHPTemplate front page (page-front.tpl.php
you can call the node of the translation corresponding to the language actually in use:
<?php
if (i18n_get_lang() == 'it') {
print node_view(node_load(array('nid' => 18)), 1);
}
elseif (i18n_get_lang() == 'en') {
print node_view(node_load(array('nid' => 19)), 1);
} ?>
if you use the default Drupal homepage (/node)
- set the alias of the main translation node (ie: home) as the homepage in the webiste settings (/admin/settings/site-information)
- set the aliases of each following translation nodes to /en/home, /fr/home, and so on.
thanks
It helps me a lot! Thanks a lot !
Post new comment