0

I'm using entity translation module and want to have different urls for front page in accordance with languages.

For example: front-eng
fr/front-page-for-france
pt/front-page-for-portugal
etc.

1 Answer 1

0

Use this code in your template file then you can page accoding to your choose language

  function yourtheme_preprocess_page(&$vars) {
        if ($vars['is_front']) {
            $langcode = $GLOBALS['language']->language;

            if ($langcode == "en") {
                drupal_goto('home');
            } elseif ($langcode == "fr") {
                drupal_goto('front-page-for-france pt');
            }
        }
1
  • The problem is that for all languages the front is same and represented in page--front.tpl.php. Just need to redirect different url for seo purposes but open the same content. Commented Mar 29, 2016 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.