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
Exalang ou Mlecms... variable vide
#2
Pour le moment, histoire que les menus s'affichent correctement, j'ai bidouillé un truc du genre:

Gabarit Page:
Code :
[== PHP ==]
{strip}

{MleCMS action='init'}
{MleCMS action='langs' template='vars'}
{process_pagedata}


{* ================
   THEME LOGIC
   ================ *}
    
{*{cms_lang_info assign='nls'}*}
{$theme_path = "{uploads_url}/glg"}

{title assign='main_title'}
{content assign='main_content'}

{cms_selflink dir='previous' assign='prev_page'}
{cms_selflink dir='next' assign='next_page'}


{/strip}

<!doctype html>

{*<!--[if IE 8]> <html lang='{$nls->htmlarea()}' dir='{$nls->direction()}' class='lt-ie9'> <![endif]-->
<!--[if gt IE 8]><!--> <html lang='{$nls->htmlarea()}' dir='{$nls->direction()}'> <!--<![endif]-->*}

<!--[if IE 8]> <html lang='{$lang_parent}' dir='ltr' class='lt-ie9'> <![endif]-->
<!--[if gt IE 8]><!--> <html lang='{$lang_parent}' dir='ltr'> <!--<![endif]-->


...

Gabarit "vars":

Code :
[== PHP ==]
{if $langs_count}
   {foreach from=$langs item=l name=language}
      {capture assign="lang_href"}{cms_selflink href=$l.alias}{/capture}
      {if $lang_href}
         {if $page_alias==$l.alias}
            {assign var=foo value="_"|explode:$l.locale}
            {assign var='lang_locale' value=$l.locale scope="global"}
            {assign var='lang_parent' value=$foo[0] scope="global"}
         {/if}
      {/if}
   {/foreach}
{/if}

Cependant cette solution est provisoire puisque bien que les entêtes de page soient dans la bonne langue, la page reste dans l'abolu en anglais (voir page contact: les erreurs s'affichent uniquement en anglais dans le formulaire)


Messages dans ce sujet

Atteindre :


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