Page 1 of 1

Menu link to front page changes language

Posted: Fri May 02, 2008 8:22 am
by bizty
On my site http://www.villavie.dk there s a bug that when users do the following:
I use CMSMS MLE version 1.2.4b

1. (Using IE) chose german language.
2. Browse to any page
3. Click the link to the front page

Now the danish front page is shown and not the german.

I have tried changing the content tag to {content view_deault=true} but it didn't change anything.

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 9:47 am
by alby
bizty wrote: 1. (Using IE) chose german language.
2. Browse to any page
3. Click the link to the front page
What is frontend link.
You can provide a step by step.

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 12:11 pm
by bizty
The error is only when using IE. Not safari.

To replicate the error:

1. Navigate to http://www.villavie.dk
2. Chose german language
3. Note the the text on the front page changes to german: "Ferirewohnung i Sudjutland. Wilkommen....."
3. Navigato to another page. Eg. "Zur Wohnung" (text is still in german)
3. Navigate back to the front page by clicking "Vorderseite"
4. Text is now Danish! It says "Ferielejlighed i sønderjylland. Velkommen...".

I think this is because the menu link to "Vorderseite" is to villavie.dk and not to villavie.dk/index.php?page=home&hl=de_DE
In Safari this works anyway because of some cookie or session I guess, but in Internet Explorer the Danish page is shows when following the link to the default page.

I hope this was what you wanted me to explain?

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 1:21 pm
by alby
bizty wrote: The error is only when using IE. Not safari.
Well, I have reproduced the problem.
Safari, IE6, FF OK
IE7 not work but only first time, if I navigate again I don't have problems

bizty wrote: I think this is because the menu link to "Vorderseite" is to villavie.dk and not to villavie.dk/index.php?page=home&hl=de_DE
In Safari this works anyway because of some cookie or session I guess, but in Internet Explorer the Danish page is shows when following the link to the default page.
Yes, IE7 have cookie problems but MenuManager with hl param has higher priority of cookie.
Why Forside (and Vorderseite) have the urls without hl? Are hardcoded?

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 2:30 pm
by bizty
The menu is not hardcoded it's based on the template Andreas01 downloaded from the templates section.

The menu script is

{* CSS classes used in this template:
#menuwrapper - The id for the that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the
.menuparent - The class for each that has children.
.menuactive - The class for each that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}


{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}

{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}

{repeat string="" times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
current == true}
haschildren == true}
url}">{$node->menutext}{/foreach}

{repeat string="" times=$node->depth-1}


{/if}

Why is the menu linking to villavie.dk without hl parameter?

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 3:01 pm
by alby
bizty wrote: The menu is not hardcoded it's based on the template Andreas01 downloaded from the templates section.
What is alias (Option tab) of this page?

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 3:37 pm
by bizty
The alias was home, now I changed it to 'front', but it didn't help.

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 3:41 pm
by alby
bizty wrote: The alias was home, now I changed it to 'front', but it didn't help.
What happen if you call /index.php?page=ALIAS&hl=de_DE

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 3:56 pm
by bizty
That works fine. That is what happens when the language selector is clicked. The problem seems to be the menu not using the hl param for the default page link.

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 5:38 pm
by alby
bizty wrote: That works fine. That is what happens when the language selector is clicked. The problem seems to be the menu not using the hl param for the default page link.
Well, my mistake, default page has root_url .....

I clear all cookies for your domain and IE works  ???

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 8:26 pm
by bizty
My IE 6 still doesn't work after clearing  the cookies. How can I change the behavior of the menu so that it doesn't link to the root url, but includes the hl parameter for all pages?

By the way, thanks a lot for helping me with this.

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 8:43 pm
by alby
bizty wrote: My IE 6 still doesn't work after clearing  the cookies. How can I change the behavior of the menu so that it doesn't link to the root url, but includes the hl parameter for all pages?

By the way, thanks a lot for helping me with this.
Default page take $config['root_url'] of config.php (SEO).
For workaround this (but this is a hack), edit lib/classes/class.content.inc.php and comment (around #1313)
        if($this->mDefaultContent) {
        $url =  $config['root_url']. '/';
//        return $url;
        }
In google "problem IE6 cookie php" or "problem IE7 cookie php" there are a bunch of links

Alby

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 9:33 pm
by bizty
Awesome! Thanks so much.

I have used your MLE version for a couple of sites now and I really like it. Things just work!

Re: Menu link to front page changes language

Posted: Fri May 02, 2008 9:47 pm
by alby
bizty wrote: Awesome! Thanks so much.
There is this patch that maybe resolve your problem.
It's untested but if you have time of testing and report  ::)

Alby