Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[RESOLU]Babel 0.4 Condition sur $page_lang ne marche pas...
#4
Hawaii4ev3r a écrit :
Jean le Chauve a écrit :Je ne connais pas ce module, mais tu peux utiliser {get_template_vars} dans ton gabarit pour connaître les variables disponibles. La variable $page_lang n'existe peut-être pas et est dénommée autrement.

Merci Jean,

lorsque je fais {get_template_vars} je vois la variable $page_lang

et pourtant le simple test
Code :
{if $page_lang == 'en_USA'}{babel show="ya"}
{elseif $page_lang == 'fr_FR'}{babel show="yi"}{/if}
ne fonctionne pas,

est-ce que je m'y prends mal ?

alors j'avance dans la gestion de mon problème
Code :
{if $page_lang == 'en_USA'}ya
{elseif $page_lang == 'fr_FR'}yi{/if}
cela fonctionne mais
Code :
{if (!isset($smarty.session.id) and empty($smarty.session.id)) and $page_lang eq 'fr_FR'}
    {literal}
        <span class="LoginButton"> <a onclick="Modalbox.show(this.href, {title: 'Login'}); return false;" href="inscription/login.php">Login</a></span>
    {/literal}
{elseif (!isset($smarty.session.id) and empty($smarty.session.id)) and $page_lang eq 'en_USA'}
    {literal}
        <span class="LoginButton"> <a onclick="Modalbox.show(this.href, {title: 'Login'}); return false;" href="inscription/login_1.php">Login</a></span>
    {/literal}
{elseif !(!isset($smarty.session.id) and empty($smarty.session.id)) and $page_lang eq 'fr_FR'}
    {literal}
        <span class="LoginButton">{cms_selflink page="fr_account"}</span>  <a onclick="Modalbox.show(this.href, {title: 'Deconnection'}); return false;" href="inscription/disconnect.php"><span id="Disconnection">Deconnection</span> </a>
    {/literal}

{elseif !(!isset($smarty.session.id) and empty($smarty.session.id)) and $page_lang eq 'en_USA'}
    {literal}
        <span class="LoginButton">{cms_selflink page="en_account"}</span>  <a onclick="Modalbox.show(this.href, {title: 'Disconnection'}); return false;" href="inscription/disconnect_1.php"><span id="Disconnection">Disconnection</span> </a>
    {/literal}
    
    {/if}
ne marche pas alors que c'est la même méthode {get_template_vars} m'affiche que page_lang : en_USA...

je ne comprends pas bien.


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)