NAVIGATION
This is an old revision of the document!
translate
Acceptance: The first navigation level is to be represented horizontal, for example in the head area of the side. The deeper levels are to be represented vertically, for example on the left side of the homepage.
Horizontal with the active level category_02
| home | category_01 | [category_02] | category_03 | category_04 |
Vertical output of the sub level from the active parent category [category_02]
Docu: –
Forum: NAV_LIST_UL in verschiedenen Ebenen (using the hepl of the Level-Lift)
Autor: K.Heermann (flip-flop) http://planmatrix.de 2009/05/13
CMS-Version: >= V1.3.0
Version: –
Update: –
Condition: → /config/phpwcms/conf.inc.php
Um das Problem zu lösen werden zwei Navigationen aufgerufen, die eine für den horizontalen, die andere für den vertikalen Bereich.
Wichtig dazu ist hier ein Parameter der horiz. Navigation.
Hier wird die Ausgabe nur einer Ebene erlaubt ({NAV_LIST_UL:F,0,1,act_path,active}).
Um die Parameter nachzulesen bitte NAV_LIST_UL (Parameter).
Eine komplettes CSS-Set: NAV_LIST_UL (CSS)
To solve the problem we need two navigations, one for the horizontal, the other one for the vertical range. Important is a parameter of the horiz. navigation.
The output is restriction to only one level ({NAV_LIST_UL:F,0,1,act_path,active}).
------------------------------------ L E V E L .: : : : .0 1 2 3 <- LEVEL-Nr. .: : : : -+ home : ID=0 -+--+ category_01 ID=01 -+--+--+ category_01_01 ID=10 -+--+--+ category_01_02 ID=11 -+--+ category_02 ID=02 -+--+--+ category_02_01 ID=04 -+--+--+--+ category_02_01_01 ID=06 -+--+--+--+ category_02_01_02 ID=07 -+--+--+ category_02_02 ID=05 -+--+--+ category_02_03 ID=08 -+--+ category_03 ID=03 -+--+ category_04 ID=09 .: : : : .0 1 2 3 <- LEVEL Nr. ------------------------------------
<div class=“nlu_navi1”>
{NAV_LIST_UL:FP,0,1,act_path,active}
</div> → only the first level (deepth=1) behind “Home (ID=0)” (here with the parent switch “P” in order to also represent Home themselves)
Exposition: | home | category_01 | [category_02] | category_03 | category_04 |
And structurally:
<file>
————————————
L E V E L
.: : : :
.0 1 2 3 ← LEVEL-No.
.: : : :
-+ home : ID=0
-+–+ category_01 ID=01
-+–+ category_02 ID=02 (if active, have a look above)
-+–+ category_03 ID=03
-+–+ category_04 ID=09
.: : : :
.0 1 2 3 ← LEVEL No.
————————————
</file>
Without the paramter “P” it looks like:
<div class=“nlu_navi1”>
{NAV_LIST_UL:FP,0,1,act_path,active}
</div> → only the first level (Tiefe=1) behins “Home (ID=0)” (here without the parent switch “P” Home is not represented)
Exposition: | category_01 | [category_02] | category_03 | category_04 |
And structurally:
<file>
————————————
L E V E L
.: : : :
.0 1 2 3 ← LEVEL-Nr.
.: : : :
-+–+ category_01 ID=01
-+–+ category_02 ID=02 (if active, see below)
-+–+ category_03 ID=03
-+–+ category_04 ID=09
.: : : :
.0 1 2 3 ← LEVEL Nr.
————————————
</file>
Now still the expenditure of the sub level is missing, in addition the level-lift is used. (Representation of navigation starting from a certain level).
==== Level-Lift: ====
This php-snippet is placed in the layout at that point, where this navigation component has to appear. (In our case the output is starting from the first level - > LEVEL_ID'][ 1 ]).
<code php>
[PHP]
if(isset($GLOBALS['LEVEL_ID'][1])) {
$level_id = $GLOBALS['LEVEL_ID'][1];
echo '<div class=“nlu_navi1”>'.LF;
echo '{NAV_LIST_UL:F,'.$level_id.',,act_path,active}';
echo '</div>';
}
[/PHP]
</code>
Where LEVEL_ID'][X] is the level which can be indicated. (Output starting from this level …).
This second navigation call ({NAV_LIST_UL:….}) thus embedded into a small controll script which queries the levels.
<note important> conf.inc.php → $phpwcms['allow_cntPHP_rt'] = 1; allow PHP replacement tags and includes in content parts </note>
==== Output of the active sub level ====
E.g. with category_02 = active (in the example this was arranged by the horizontal Navi)
* category_02_01
* category_02_02
* category_02_03
<file>
————————————
L E V E L
.: : : :
.0 1 2 3 ← LEVEL-No.
.: : : :
-+–+–+ category_02_01 ID=04
-+–+–+ category_02_02 ID=05
-+–+–+ category_02_03 ID=08
.: : : :
.0 1 2 3 ← LEVEL No.
————————————
</file>
E.g. with category_02 = active → act_path (horizontal) and category_02_01 = active:
* category_02_01
* category_02_01_01
* category_02_01_02
* category_02_02
* category_02_03
<file>
————————————
L E V E L
.: : : :
.0 1 2 3 ← LEVEL-No.
.: : : :
-+–+–+ category_02_01 ID=04 (active)
-+–+–+–+ category_02_01_01 ID=06
-+–+–+–+ category_02_01_02 ID=07
-+–+–+ category_02_02 ID=05
-+–+–+ category_02_03 ID=08
.: : : :
.0 1 2 3 ← LEVEL No.
————————————
</file>
==== Summary: ====
<div class=“nlu_navi1”> {NAV_LIST_UL:FP,0,1,act_path,active} </div>
and
<code php>
[PHP]
if(isset($GLOBALS['LEVEL_ID'][1])) {
$level_id = $GLOBALS['LEVEL_ID'][1];
echo '<div class=“nlu_navi1”>'.LF;
echo '{NAV_LIST_UL:F,'.$level_id.',,act_path,active}';
echo '</div>';
}
[/PHP]
</code>
the outcome of this is (with active level category_02)
| home | category_01 | [category_02] | category_03 | category_04 |
* category_02_01
* category_02_02
* category_02_03
or (with active level category_02 and category_02_01)
| home | category_01 | [category_02] | category_03 | category_04 |
* category_02_01
* category_02_01_01
* category_02_01_02
* category_02_02
* category_02_03