2011-10-07, 00:42:28
missfx Wrote:How add .current (if it's possible) on my flags links ?
(I use <?php echo htmlspecialchars(return_i18n_lang_url('en')); ?> )
Thanks a lot
Something like the following (assuming en as default languages, de and es as additional languages):
Code:
<?php
$clang = return_i18n_default_language();
$langs = return_i18n_languages();
foreach ($langs as $l) if ($l == 'de' || $l == 'es') { $clang = $l; break; }
?>
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('en')); ?>" class="<?php if ($clang == 'en') echo 'current'; ?>">...</a>
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('de')); ?>" class="<?php if ($clang == 'de') echo 'current'; ?>">...</a>
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('es')); ?>" class="<?php if ($clang == 'es') echo 'current'; ?>">...</a>