{NAV_ROW} dynamic
-
- Posts: 9
- Joined: Fri 11. Jun 2004, 16:22
- Location: Mömbris, Germany
- Contact:
{NAV_ROW} dynamic
Hallo zusammen,
ich benutze als Hauptnavigation den {NAV_LIST_TOP}-Tag. Als Ergänzung dazu habe ich den {NAV_ROW}-Tag im Einsatz, der Kontextbezogen die zweite Navigationsebene zeigen soll. Benutze ich aber hier {NAV_ROW:CURRENT}, so verschwindet diese Navigation, wenn ich mich in der zweiten Ebene befinde (da keine Ebene mehr untergeordnet ist). Dies lässt sich zwar mit dem Tag {NAV_ROW:INT:0} lösen, jedoch muss ich hier für jede Seite ein eigenes Template erstellen. Gibt es keine Möglichkeit, das Ziel auch mit nur einem Template zu erreichen? Ich habe von nav.php gelesen, das genau das ermöglichen soll, allerdings nur in Verbindung mit {NAV_TABLE}, nicht aber mit "ROW" funktioniert. Hat irgendjemand einen Lösungsansatz?
Vielen Dank
Fabi
----------------------------------------------------------------------------------
Cheers,
I'm using {NAV_LIST_TOP} as main navigation and I want to get the second navigation-level with {NAV_ROW}. If I use {NAV_ROW:CURRENT}, the navigation disappears when visiting a site in the second level. This could be solved by using {NAV_ROW:INT:0}, I know. But this would make necessary to use own templates for every site, so I'd like to know if there is another possibility (I read something about the nav.php that can do exactly this but this is only for {NAV_TABLE}-Tags)?!.
Thanks for your help!
Fabi
ich benutze als Hauptnavigation den {NAV_LIST_TOP}-Tag. Als Ergänzung dazu habe ich den {NAV_ROW}-Tag im Einsatz, der Kontextbezogen die zweite Navigationsebene zeigen soll. Benutze ich aber hier {NAV_ROW:CURRENT}, so verschwindet diese Navigation, wenn ich mich in der zweiten Ebene befinde (da keine Ebene mehr untergeordnet ist). Dies lässt sich zwar mit dem Tag {NAV_ROW:INT:0} lösen, jedoch muss ich hier für jede Seite ein eigenes Template erstellen. Gibt es keine Möglichkeit, das Ziel auch mit nur einem Template zu erreichen? Ich habe von nav.php gelesen, das genau das ermöglichen soll, allerdings nur in Verbindung mit {NAV_TABLE}, nicht aber mit "ROW" funktioniert. Hat irgendjemand einen Lösungsansatz?
Vielen Dank
Fabi
----------------------------------------------------------------------------------
Cheers,
I'm using {NAV_LIST_TOP} as main navigation and I want to get the second navigation-level with {NAV_ROW}. If I use {NAV_ROW:CURRENT}, the navigation disappears when visiting a site in the second level. This could be solved by using {NAV_ROW:INT:0}, I know. But this would make necessary to use own templates for every site, so I'd like to know if there is another possibility (I read something about the nav.php that can do exactly this but this is only for {NAV_TABLE}-Tags)?!.
Thanks for your help!
Fabi
-
- Posts: 9
- Joined: Fri 11. Jun 2004, 16:22
- Location: Mömbris, Germany
- Contact:
If someone is interested: It seems, I solved the problem. I modified the nav.php (from folder sample_ext_php) to navrow.php:
As far as I tested, it works fine. Just use {PHP:} to include it instead of {NAV_ROW}. Maybe this will help someone?
Merry christmas to all of you!
Fabi
Code: Select all
<?php
// used to return the code for menu based on given ID
// can be used to use only 1 template for all
// get the current level ID
$check_id = $GLOBALS['content']['cat_id'];
while ( $GLOBALS['content']['struct'][$check_id]['acat_struct'] > 0 ) {
$check_id = $GLOBALS['content']['struct'][$check_id]['acat_struct'];
}
switch($check_id) {
case 1: //level1
echo '{NAV_ROW:1:0}';
break;
case 2: //level2
echo '{NAV_ROW:2:0}';
break;
case 3: //level3
echo '{NAV_ROW:3:0}';
break;
case 4: //level4
echo '{NAV_ROW:4:0}';
break;
case 5: //level5
echo '{NAV_ROW:5:0}';
break;
default: //default
echo '{NAV_ROW:0:0}';
}
?>
Merry christmas to all of you!
Fabi
-
- Posts: 9
- Joined: Fri 11. Jun 2004, 16:22
- Location: Mömbris, Germany
- Contact:
I think in the new DEV-Release ist is no longer included -
use older releases if you need the file.
But the code posted at the top is all you need -
just create the file yourself.
use older releases if you need the file.
But the code posted at the top is all you need -
just create the file yourself.
Last edited by Marie_Huana on Tue 8. Mar 2005, 21:02, edited 1 time in total.
NAV_ROW fixed in second level
Marie_Huana
I found a solution to fix the second navigation-level so it wont disappear when you click a link on this second level.
It works only for max. 2 navigation-levels, of course
It works in DEV-Release and schould work in all former releases as well.
in file: include/inc_front/front.func.inc.php
in your template you can now use {NAV_ROW:CURRENT:0} (it only makes sense with actual-site OFF) for the second navigation-level so you wont have to create a different template for each main-navigation-category.
I found a solution to fix the second navigation-level so it wont disappear when you click a link on this second level.
It works only for max. 2 navigation-levels, of course
It works in DEV-Release and schould work in all former releases as well.
in file: include/inc_front/front.func.inc.php
Code: Select all
---FIND---
// check against breadcrumb - active site tree
if($GLOBALS['content']['struct'][$GLOBALS['content']["cat_id"]]['acat_struct'] != 0) {
$breadcrumb = get_breadcrumb($GLOBALS['content']["cat_id"], $GLOBALS['content']['struct']);
}
---ADD AFTER---
// if it wants to go deeper than 2 levels from main-navigation then set cat_id back to main-navigation-id
if (count($breadcrumb) > 2 && strtoupper($show_id) == "CURRENT") {
$act_cat_id = $GLOBALS['content']['struct'][$act_cat_id]['acat_struct'];
}