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
[Résolu]Récupérer le niveau hiérarchique d'une page appelante
#9
Smile Trop fort ! Excellent, Ca marche...

J'avais pourtant essayé plusieurs trucs du genre, le 'code' actuel étant:

Code :
# Name: hierarchy
global $gCms;
$depth= $_GET['Depth'];
$pos = $gCms->variables['position'];
$base = explode('.', $pos);
$smarty->assign('h_level', $depth);
$smarty->assign('h_cur_level', $pos);
$smarty->assign('h_toplevel', $base[0] * 1);
$smarty->assign('h_parent',   $base[ (count($base) > 1) ? count($base)-2 : 0 ] * 1);
$smarty->assign('h_this',     $base[count($base)-1] * 1);

# echo $_SERVER["HTTP_REFERER"];
# echo "position: ".$depth." - ".$_SESSION['src_level']."<br>";
# echo "position: ".$depth." - ".$h_src_level."<br>";
# $tpl_vars = $smarty->get_template_vars();
# print_r($tpl_vars );
# print_r($gCms);
Mais là, c'est tout bon, plus besoin de passer le $depth en argument.

La "page générique" est devenue:

Citation :{hierarchy}{menu start_element=$new_var template="minimal_psn"}

{equipe}

$new_var remplacant $h_level.

Mille mercis !!


Messages dans ce sujet

Atteindre :


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