Internationalisation and replace_link_with_first_nav

Permalink
Hi,

i have a new Concrete5 Page and I´m building the menu right now. The page is in 4 languages.

the sitemap looks like:

HOME
.....German
.......... One
..........Two
..........Three
.....English
..........One
..........Two
..........Three
........
........

I use the internationalisation add-on. There i checked this option: "Redirect home page to default language section." Then it redirects to the Page "German" but there is only content on "one". I set the attribute of "German" to "Replace Link with first Nav".
But it didn´t get replaced... only when i click on the German button, but not if i first visit the site. Does anybody know how i can handle that?

Greeeetings ;)

micrdy
 
micrdy replied on at Permalink Reply
micrdy
Nobody can help? It just need to open the Site German-One if i go to HOME...
PatrickHeck replied on at Permalink Reply
PatrickHeck
Hi micrd,

try to put this at the beginning of your themes element/header.php

/* If this page has the attribute replace_link_with_first_in_nav then redirect to that page instead */
if ($c->getCollectionAttributeValue('replace_link_with_first_in_nav')) {
    $subPage = $c->getFirstChild();
    if ($subPage instanceof Page) {
            $nh = Loader::helper('navigation');
            header ("HTTP/1.1 301 Moved Permanently");
            header ("Location: " . $nh->getLinkToCollection($subPage));
            exit();
    }
}


Best
Patrick