Differences

This shows you the differences between two versions of the page.

english:navigation:little-helper:level-lift [2009/05/16 01:25]
Knut Heermann (flip-flop) created
english:navigation:little-helper:level-lift [2018/06/03 18:09] (current)
Line 3: Line 3:
====== Level-Lift ====== ====== Level-Lift ======
-FIXME translate 
-Ebenen (Level) können unabhängig der ID abgefragt werden, dazu bedarf es eines kleinen Skriptes. Ich stelle hier die grundlegende Verwendung dar.+ 
 +Level can be queried independently the ID, in addition it requires a small script. I represent here the fundamental use.
**Docu:** -- \\ **Docu:** -- \\
Line 14: Line 14:
**Update:** -- \\ **Update:** -- \\
-**Bedingung:**  -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\+**Condition:**  -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml]] \\
  * $phpwcms['allow_cntPHP_rt']   = 1;   * $phpwcms['allow_cntPHP_rt']   = 1;
Line 22: Line 22:
\\ \\
-===== Grundlage Level und ID =====+===== Basis level and ID =====
-Wir unterscheiden zwischen ID-und Level-basierten Einsprungpunkten. +We differentiate between ID-and level-based points of re-entry point. ID= Absolute point of re-entry point:
-ID= Absoluter Einsprungpunkt:+
-Funktioniert in jeder Lebenslage, auch wenn ich nicht in dem gekennzeichneten Baum-Teil stehe. +Functioned in each situation in life, even if I am not located in the characterized tree part. (ID= side structure (with the mouse over the little book sheet)).
-(ID= Seitenstruktur (mit der Maus über das Blättchen fahren)).+
-Level= Relativer Einsprungpunkt:+Level= relative point of re-entry point:
-Z.B. kann eine Skript oder {RT} abgearbeitet werden, wenn ich mich in dem angegebenen Level (oder Level-Bereich) befinde+E.g. a script or {RT} can be processed, if I stay in the indicated level (or level range).  
-(Level: Betrachte die Baumstruktur einmal Spaltenweise, dann siehst du die Level). +(Level: Regard the tree structure once in columns, then you see the level).
-**Annahme** //(IDs sind frei erfunden)//:+**Condition** //(IDs are freely invented )//:
<file> <file>
 ------------------------------------  ------------------------------------
L  E  V  E  L L  E  V  E  L
.:  :  :  : .:  :  :  :
-.0  1  2  3   <- LEVEL-Nr.+.0  1  2  3   <- LEVEL-No.
.:  :  :  : .:  :  :  :
-+ home   :                    ID=0 -+ home   :                    ID=0
Line 53: Line 51:
-+--+ category_04              ID=09 -+--+ category_04              ID=09
.:  :  :  : .:  :  :  :
-.0  1  2  3   <- LEVEL Nr.+.0  1  2  3   <- LEVEL No.
------------------------------------ ------------------------------------
</file> </file>
-==== ID-basiert: ====+==== ID-based: ====
   
-Die Ebene wird absolut adressiert. \\ +The level is absolutely addressed. \\ 
-Der Vorteil ist, dass diese Ebene von einem Skript oder {RT} immer abgearbeitet wird, gleich wo der Client sich gerade auf der Seite befindet. \\ +The advantage: This level is always processed by a script or {RT}, equal where the client stays on the side. \\
-Der Nachteil ist, dass ich bei verschiedenen Ebenensträngen für dieses Verfahren mehrere Vorlagen brauche.+
-==== Levelbasiert: ====+The disadvantage: If we use different level strands, we needed several templates for this procedure.  
 + 
 +==== Level-based: ====
   
-Die Ebene wird relativ adressiert. \\ +The level is relatively addressed . \\ 
-Der Vorteil ist, dass ich z.B. einen {RT} in die Vorlage schreibe und alle vom Client gerade aktivierten Ebenen damit angesprochen werden können, die auf das Schema passen. \\ +The advantage: If we e.g. write one {RT} into the template all client activated levels can be addressed, which fit on the pattern. \\ 
-Der Nachteil ist, dass ich keine Ebene anzeigen kann, die nicht gerade vom Client aufgerufen ist.+ 
 +The disadvantage: We cannot display a level, which is not called by the Client straight.
\\ \\
==== Test: ==== ==== Test: ====
-Ich möchte ein bestimmtes Bild ausgeben, wenn der Benutzer in der Kategorie **category_02_01** steht, in allen anderen Kategorien wird ein anderes Bild ausgeliefert:+I would like to spend a particular picture if the user stays in the category **category_02_01**, in all other categories another picture is delivered:
-=== ID-basiert: ===+=== ID-based: ===
<code php> <code php>
[PHP] [PHP]
-if ($GLOBALS['content'][cat_id] == 4) { // ist die ID=4 aktiv? (User gerade auf der Seite category_02_01)+if ($GLOBALS['content'][cat_id] == 4) { // ist die ID=4 aktiv? (User stays at the site category_02_01)
  echo <img src="img/backend/sourceforge.gif' border="0" alt="" />'.LF;   echo <img src="img/backend/sourceforge.gif' border="0" alt="" />'.LF;
Line 87: Line 87:
[/PHP] [/PHP]
</code> </code>
-Ein klassisches Beispiel für eine **ID-basierte absolut adressierte Abfrage**. Egal an welcher Stelle sich der User auf der Seite befindet //(außer in category_02_01)// es wird immer ein Bild ausgeliefert. 
 +A classical example of an ** ID-based absolutely addressed query **. It is insignificant in which place the user on the side is  
 +//(except in category_02_01), // always a picture is delivered.
-Ich möchte jedoch für das gesamte erste, zweite und dritte Level jeweils ein eigenes Bild ausgeben, also muss ich das Level prüfen. +I would like to display a own picture in each case for the first, second and third level, therefore I must check the level.
-=== Level-basiert: ===+=== Level-based: ===
-<code php|h Level pruefen |h>>+<code php|h Level check |h>
[PHP] [PHP]
-$my_image = 'img/backend/preinfo2.jpg';  // voreingestelltes Bild Level 0 und 1+$my_image = 'img/backend/preinfo2.jpg';  // preset picture level 0 and 1
-if(isset($GLOBALS['LEVEL_ID'][2])) {   // 2 fuer das zweite Level -> ist das 2. Level aktiv?  +if(isset($GLOBALS['LEVEL_ID'][2])) {   // 2 for the second level  -> is the 2nd level active?  
-  $my_image = 'img/backend/hotscripts.gif';  // Bild fuer alle Kategorien im 2. Level+  $my_image = 'img/backend/hotscripts.gif';  // Picture for all categories in the 2nd level
     
-  if (isset($GLOBALS['LEVEL_ID'][3])) {   // gibt es ein aktives drittes Level?  +  if (isset($GLOBALS['LEVEL_ID'][3])) {   // does it give an active third level?  
-    $my_image = 'img/backend/sourceforge.gif';  // Bild fuer alle Kategorien im 3. Level+    $my_image = 'img/backend/sourceforge.gif';  // Picture for all categories in the 3rd level
  }   }
} }
-// Bildausgabe+// Image output
echo '<img src="'.$my_image.'" border="0" alt="" />'.LF;   echo '<img src="'.$my_image.'" border="0" alt="" />'.LF;  
-// ======= Testsektion: Ausgabe Level / Kategorie / ID+// ======= Test section: Output level / category / ID
$level = 0; $level = 0;
-for ($i = 0; $i <= $level; $i++) {  // Wieviele Level sind vorhanden?+for ($i = 0; $i <= $level; $i++) {  // How many level are present?
  isset($GLOBALS['LEVEL_ID'][$i]) ? $level++ : $level--;   isset($GLOBALS['LEVEL_ID'][$i]) ? $level++ : $level--;
} }
-// Aktuellen Kategorie-alias und ID auslesen+// Current category alias and ID select  
$cat_alias = $GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"]; $cat_alias = $GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"];
$cat_id =    $GLOBALS['content']['cat_id']; $cat_id =    $GLOBALS['content']['cat_id'];
echo 'Level='.$level.' Cat.'.$cat_alias.' ID='.$cat_id.LF; echo 'Level='.$level.' Cat.'.$cat_alias.' ID='.$cat_id.LF;
-// ======= Ende Testsektion+// ======= Ende test section
[/PHP] [/PHP]
</code> </code>
-In dem Array ##$LEVEL_ID[**X**]## steckt also die gesuchte Information.  +The wanted information is inside the array ##$LEVEL_ID[**X**]## . 
-Ist das Level vorhanden, //(isset($LEVEL_ID[**X**])// wird die aktuelle Kategorie-ID als Inhalt geliefert.+ 
 +If the level is present, //(isset($LEVEL_ID[**X**])// the current category ID is supplied as contents. 
 + 
 +Also completely different instructions can be processed instead of the image output. No borders are set to the fantasy.  
-Es können auch ganz andere Anweisungen anstatt der Bildausgabe abgearbeitet werden. Der Fantasie sind keine Grenzen gesetzt. 
==== Level-Lift ==== ==== Level-Lift ====
-Der Level-Lift arbeitet genau nach diesem Verfahren und wird typischerweise für getrennte Navigationen eingesetzt. +The level-lift works exactly like this method and is used typically for separate navigations.
<code php> <code php>
[PHP] [PHP]
-if(isset($GLOBALS['LEVEL_ID'][1])) {  // hier wird das erste level abgefragt+if(isset($GLOBALS['LEVEL_ID'][1])) {  // the first level is queried
$level_id = $GLOBALS['LEVEL_ID'][1]; $level_id = $GLOBALS['LEVEL_ID'][1];
echo '<div class="untermenu">'.LF; echo '<div class="untermenu">'.LF;
Line 145: Line 150:
[/PHP] [/PHP]
</code> </code>
-Level = Spaltenwert 0, 1, 2, .... (relativ Navigation) \\ +Level = column No. 0, 1, 2, .... (relative navigation) \\ 
-ID= Nummeraler Wert der Seitenebene in der Seitenstruktur (Maus über das Blättchen bewegen) (absolute Navigation) +ID= Numeral value of the side level in the side structure (move mouse over the little book sheet) (absolute navigation)  
 + 
 +\\ 
 + 
 +**Since version r317 available:** //[[english/technics/system-variables#new_tag_levelx_id|New tag {LEVELX_ID}]] //  
 + 
 +<code php> 
 +[PHP] 
 +if(isset($GLOBALS['LEVEL_ID'][1])) {  // hier wird das erste Level abgefragt 
 +echo '<div class="untermenu">'.LF; 
 +echo '<h1>Filme</h1>'.LF; 
 +echo '{NAV_LIST_UL:F,{LEVEL1_ID},1,act_path,active,,,#|}'; 
 +echo '</div>'; 
 +
 +[/PHP] 
 +</code> 
-Siehe hierzu: [[deutsch/navigationen/nav_list_ul-beispiele/navi-verschiedene-ebenen|Navigation in verschiedenen Ebenen]]+Have a look: [[english:navigation:nav_list_ul-example:navi-different-level]]
english/navigation/little-helper/level-lift.1242429919.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0