Menu link to front page changes language

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
bizty

Menu link to front page changes language

Post 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.
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post 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?
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post 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?
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post by bizty »

The alias was home, now I changed it to 'front', but it didn't help.
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post 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.
Last edited by bizty on Fri May 02, 2008 4:01 pm, edited 1 time in total.
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post 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.
alby

Re: Menu link to front page changes language

Post 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
bizty

Re: Menu link to front page changes language

Post 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!
alby

Re: Menu link to front page changes language

Post 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
Locked

Return to “[locked] CMSMS MLE fork”