I've a problem with my front page and the i18n (languages are italian and english):

I've created a page-front_it.tpl.php and a page-front_eng.tpl.php in my custom theme (they have to look different from the rest of the site); the problem is how can I switch from the italian version to the english version of the front page.

In page.tpl.php I've put this code at the top of the file (in php tags):

if ($is_front) {
include('page-front_it.tpl.php');
return;
}

(I haven't yet try to include 'page-front_eng.tpl.php')

but the front page doesn't work if the url is with the /?q=it/node (for italian) and the /?q=eng/node (for english). It works (for the italian one) only if the url is like www.example.com

How can I configure drupal to switch languages in custom front pages, from www.example.com/?q=it/node to www.example.com/?q=eng/node?

Thanks

p.s. for the Admin: I'm sorry i've posted the same question in http://drupal.org/node/44510#comment-129084 so please remove it because I've seen it was a post related to 4.6 version...

Comments

rafvall1’s picture

I'm trying with this code but it doesn't work...

in sites/default/settings.php:

$conf['i18n_variables'] = array(
// Site configuration
'site_name',
'site_slogan',
'site_mission',
'site_frontpage',
'it_frontpage',
'en_frontpage',
'site_footer',
'anonymous',
);

in my theme page.tpl.php at top of the code:

$it_frontpage = variable_get('site_frontpage', 'it');
if ($it_frontpage) {
include('page-front_it.tpl.php');
return;
}
$en_frontpage = variable_get('site_frontpage', 'en');
if ($en_frontpage) {
include('page-front_eng.tpl.php');
return;
}

I'm not expert with php..with this code the only result is that the index.php, the /?q=it and the /?q=en pages look like the page-front_it.tpl.php ... I can't switch the frontpage from italian to english...

rafvall1’s picture

It doesn't work nothing for me....but I've seen in ithe Internationalization issues that the problems with the frontpage and the expansion of menus are still active.

Is it possible in your opinion to create a special node-something.tpl.php assigned for example to a "/node/1" (my frontpage in italian) and to a "/node/2" (my frontpage in english)?...Translation for nodes works well.

I need to create a frontpage with a different look from others node, but I need to switch the language for frontpage..

p.s. please any suggestion is very appreciated. (Am I in the right section????)

texas-bronius’s picture

Peep the discussion on switching between languages on specific pages in drupal with i18. We've covered a good bit of basic info here like separate menus, jumping between languages within pages and frontpages, etc.

I hope this helps.

Something that eludes me at present is how to have the front page default to the "language path structure" just like in Jose's site. Notice that my link was "/" but his page redirects to "/en".

--
..happiness is point and click..

--
http://drupaltees.com
80s themed Drupal T-Shirts