How to change Your Language drop down menu to flag version?

How to change Your Language drop down menu to flag version?

Please refer attachment.

5 answers

Profile photo of Sherlock 0.00 $tone March 11, 2013
Public

Hi victorlai,

1) you put the images flags folder that I attached here to the folder of skin\frontend\default\jm_scerif\images
2) You create the languages file of app\design\frontend\default\jm_sceriftemplate\pag e\switch\languages.phtml and put into it this content

PHP Code:

<?php

/**

 * Magento

 *

 * NOTICE OF LICENSE

 *

 * This source file is subject to the Academic Free License (AFL 3.0)

 * that is bundled with this package in the file LICENSE_AFL.txt.

 * It is also available through the world-wide-web at this URL:

 * http://opensource.org/licenses/afl-3.0.php

 * If you did not receive a copy of the license and are unable to

 * obtain it through the world-wide-web, please send an email

 * to [email protected] so we can send you a copy immediately.

 *

 * DISCLAIMER

 *

 * Do not edit or add to this file if you wish to upgrade Magento to newer

 * versions in the future. If you wish to customize Magento for your

 * needs please refer to http://www.magentocommerce.com for more information.

 *

 * egory    design

 * @package     base_default

 * Copyright (c) 2012 Magento Inc. ([url]http://www.magentocommerce.com[/url])

 * @license     [url]http://opensource.org/licenses/afl-3.0.php[/url]  Academic Free License (AFL 3.0)

 */

?>

<?php

/**

 * Language switcher template

 *

 * @see Mage_Page_Block_Switch

 */

?>

<?php 
if(count($this->getStores())>1): ?>

<div class="form-language">

        <label class="select-language"><?php echo $this->__('Your Language:'?></label>

    <div class="langs-wrapper">

    <?php foreach ($this->getStores() as $_lang): ?>

        <a class="lang-flag <?php if ($_lang->getCode()== 'default'): echo "lang-default"; endif; ?>" title="<?php echo $_lang->getCode() ?>" href="<?php echo $this->getCurrentUrl() . '?___store=' $_lang->getCode();?>"><img src="<?php echo $this->getSkinUrl('images/flags/' $_lang->getCode() . '.png');?>" alt="<?php echo $_lang->getCode() ?>" /></a>

    <?php endforeach;?>

    </div>

</div>

<?php endif;?>


I hope that helps !

#2
Profile photo of Victor Lai 0.00 $tone July 21, 2013
Public

Hi Sherlock Holmes,

Thanks for your precious info.

But I would like the "Your Language:" same row with the flags. May I know how to edit the languages.phtml to suit my requirement?

Refer attachment.

#3
Profile photo of Sherlock 0.00 $tone July 22, 2013
Public

Hi victorlai,

Just open the file skin/frontend/default/jm_scerif/css/theme.css look for this css rule

HTML Code:

   .form-language label {
                     padding-right: 5px;
                  }

change to

HTML Code:

.form-language label {
                     float: left;
                     padding-right: 5px;
                  }

also add a new css rule of

HTML Code:

div.langs-wrapper{
                    float:left
                }

I think this would help !

#5

Please login or Register to Submit Answer

Written By

Comments