Magento changing the language selector

figu120

New Member
In my project i have to display the webshop in two languages.By default you can choose languages with the following code in:app/design/frontend/base/default/template/page/switch/language.phtml\[code\]<?php if(count($this->getStores())>1): ?><div class="form-language"><label for="select-language"><?php echo $this->__('Your Language:') ?></label><select id="select-language" title="<?php echo $this->__('Your Language') ?>" onchange="window.location.href=http://stackoverflow.com/questions/12798973/this.value"><?php foreach ($this->getStores() as $_lang): ?> <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?> <option value="http://stackoverflow.com/questions/12798973/<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option><?php endforeach; ?></select></div><?php endif; ?>\[/code\]This of course displaya a select box with the options being all the languages.I however want to change this so that it become seperate links.I just don't really know how to do this.This is what i have now.\[code\]<?php if(count($this->getStores())>1): ?><div class="form-language"><?php foreach ($this->getStores() as $_lang):?> <a href="" title=""><?php echo $this->htmlEscape($_lang->getName()) ?></a><?php endforeach;?></div><?php endif; ?>\[/code\]PS: I did not change this in the default magento code. I am working in app/design/frontend/default/projectname/template/page/switch/language.phtml.
 
Back
Top