i18n custom frontpage
Last modified: March 20, 2008 - 14:08
Hi Folks
I was trying custom my frontpage with i18n. (with tpl.php files) I read a lot of things in special http://drupal.org/node/134003
But unfortunately didnt work for me.
So I created this snippet to use in page.tpl.php . I am not sure will work in production site because my website isnt finished.
I will appreciate comments and know if is working well
<?php
if (arg(0)=="admin" && i18n_get_lang() == 'en') {
include('page-default.tpl.php');
return;
}
elseif (arg(0)=="admin" && i18n_get_lang() == 'it') {
include('page-default.tpl.php');
return;
}
/* repeat to all languages */
elseif (arg(0)=="node" && arg(1)=="add" && arg(2)=="mycck" && i18n_get_lang() == 'en') {
include('page-mycck.tpl.php');
return;
}
elseif (arg(0)=="node" && arg(1)=="add" && arg(2)=="mycck" && i18n_get_lang() == 'pt') {
include('page-mycck.tpl.php');
return;
}
elseif (arg(0)=="node" && arg(1)=="add" && arg(2)=="mycck" && i18n_get_lang() == 'it') {
include('page-mycck.tpl.php');
return;
}
/* repeat to all languages, and insert all paths of drupal */
elseif (i18n_get_lang() == 'en') {include('front-en.tpl.php');return;}
elseif (i18n_get_lang() == 'it') {include('front-it.tpl.php');return;}
elseif (i18n_get_lang() == 'pt') {include('front-pt.tpl.php');return;}
elseif (i18n_get_lang() == 'fr') {include('front-fr.tpl.php');return;}
else
include 'page-default.tpl.php'; /*if none of the above applies, load the page-default.tpl.php by macm */
return;
?>Regards
macm
Mario

try panels2
http://drupal.org/node/256558
greets,
Drupal Berlin
________________
http://www.drupalberlin.com
It's actualy far easier than this
You can include in your settings.php (sites/default)
'site_frontpage' in your $conf['i18n_variables']
then go to: /admin/settings/site-information and apply a different node per language by switching languages within this page. Works as expected, and no need for coding anything.
Greetings from Barcelona