EDIT CODE WELGOT
-
I have website and i have plugin Weglot, when will change website language, button “change language” change possition. I would lika have buttons always the same possition, In weglot.php where I must change code ?
The page I need help with: [log in to see the link]
-
Hi,
I’m not sure I understand, you would like to have always the “PL” button on the left and always “EN” button on the right ?
Exactly I would like have button “PL” on left side and button “EN” on right Side always
-
This reply was modified 8 years, 3 months ago by
ldybiec.
ok, I see. In this case enter the following code in the field “Override CSS” of the plugin.
.wg-flags.en { float: right!important; }Then save 🙂
Thanks it works, but I have yet problem because when i click button”EN” i would like add on url “& wmc-currency=GBP” and when i click button “PL” will add “wmc-currency=PLN”.
I wrote variable “$value1 = ‘&wmc-currency=GBP’ ;” in weglot.php and I added in code
$list .= '<li class="wg-li ' . $flag_class . $d . '"> <a data-wg-notranslate href="' . $link .$value1 .'">' . ($withname ? ($full ? WGUtils::getLangNameFromCode( $d,false ) : strtoupper( $d )) : '') . '</a></li>';it’s working, but on once side. Can you help me?
-
This reply was modified 8 years, 3 months ago by
ldybiec.
For this I’m not sure, but what you did is good.
What do you mean “for one side” ? I went to your website http://asgym.pl/ but I don’t see the currency=GBPYes I see what you want to do but Weglot doesn’t allow this by default. It should be possible by changing some code but it can be hard.
Maybe write:
$value[‘en’] = ‘&wmc-currency=GBP
$value[‘pl’] = ‘&wmc-currency=PLNThen in the code, something like
$list .= '<li class="wg-li ' . $flag_class . $d . '"> <a data-wg-notranslate href="' . $link .$value[$d] .'">' . ($withname ? ($full ? WGUtils::getLangNameFromCode( $d,false ) : strtoupper( $d )) : '') . '</a></li>';I haven’t tested this code but it should be something around this
Everything of working, thank you so much
I have one more problem, because when I click the button “EN” in url add a new value “?wmc-currency=GBP” but when I click button “PL” currency doesn’t change becuse is added to the previous value, so url always appends add new value to old. How can I change code i weglot.php that i will change language old value currency will delete and will add new value. Can you open page asgym.pl and help me?
You will need to detect the URL and remove the ?wmc-currency=GBP from the link so that you don’t have http://asgym.pl/?wmc-currency=GBP?&wmc-currency=PLN but only
http://asgym.pl/?&wmc-currency=PLN
in the code you can use parse_url function on the link, then remove parametersCould you help me with function parse_url because I can’t do it.
You can check the documentation about parse_url here
It will help you -
This reply was modified 8 years, 3 months ago by
The topic ‘EDIT CODE WELGOT’ is closed to new replies.