Language Selection as Drop Down

Hi!

I would like to have the language selection as a drop down menu with the country flag! how can I do this.

Many Thanx

Lopty

Hi Lopty,

this should simply could be done with pure html:
http://de.selfhtml.org/html/formulare/auswahl.htm

Regards

Hi Marco!

Thanx for the quick reply.

So this is the code:

            [{if $oView->isLanguageLoaded() }]
                [{foreach from = $oxcmp_lang item = _language}]
                    <a id="test_Lang_[{$_language->name}]" class="language[{if $_language->selected}] act[{/if}]" href="[{ oxgetseourl ident=$_language->link params=$oView->getDynUrlParams() }]" hreflang="[{ $_language->abbr }]" title="[{ $_language->name }]"><img src="[{$oViewConf->getImageUrl()}]lang/[{ $_language->abbr }].gif" alt="[{$_language->name}]"></a>
                [{/foreach}]
            [{/if}]

Now what do I have to insert for the “form action”, “select name” & “option” values?

Thanx again

Lopty

[QUOTE=Marco Steinhaeuser;33339]Hi Lopty,

this should simply could be done with pure html:
http://de.selfhtml.org/html/formulare/auswahl.htm

Regards[/QUOTE]

Hi Marco,

Thanx for the quick respond, however that link did not help! anyway I solved it with some javascript. So this is what I did.

1.) In _header.tpl insert the following javascript code before </head>

<script language="JavaScript" type="text/JavaScript">
<!--
function ADMA_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ADMA_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

2.) Replace:

                [{if $oView->isLanguageLoaded() }]
                    [{foreach from = $oxcmp_lang item = _language}]
                        <a id="test_Lang_[{$_language->name}]" class="language[{if $_language->selected}] act[{/if}]" href="[{ $_language->link|oxaddparams:$oView->getDynUrlParams() }]" hreflang="[{ $_language->abbr }]" title="[{ $_language->name }]"><img src="[{$oViewConf->getImageUrl()}]lang/[{ $_language->abbr }].gif" alt="[{$_language->name}]"></a>
                    [{/foreach}]
                [{/if}]

With:


              [{if $oView->isLanguageLoaded() }]
                 <select name="select" onChange="ADMA_jumpMenu('parent',this,0)">
              [{foreach from = $oxcmp_lang item = _language}]
                 <option value="[{ $_language->link|oxaddparams:$oView->getDynUrlParams() }]" [{if $_language->selected}]selected[{/if}]>[{ $_language->name }]</option>
              [{/foreach}]
             </select>
             [{/if}]

That´s it! Now You have a drop down menu with the available languages! :slight_smile:

Regards
Lopty

Hi,

cool. Thanks for the code!

Regards

@loptimop - can we see this in action somewhere?

Thanks