Page 1 of 1
Get the current site structure level
Posted: Mon 21. Feb 2005, 11:22
by Rainer G
With:
{NAV_TABLE_COLUMN:integer}
can i set the beginning of the NavMenü.
With {NAV_ROW_CURRENT} starts the Menü with the next entry below. This will i do with the NAV_TABLE_COLUMN.
How can i get the current id to set in {NAV_TABLE_COLUMN:id}?
A good new replacement-tag for the future: {NAV_TABLE_CURRENT}
Posted: Mon 21. Feb 2005, 11:48
by rk
Posted: Mon 21. Feb 2005, 11:59
by Rainer G
I use the RC4
, the dev only for testing.
Posted: Mon 21. Feb 2005, 12:09
by Pappnase
hello
to get the id move the mouse over this icon in admin -> sitestructure, then you will see it.
Posted: Mon 21. Feb 2005, 12:17
by Rainer G
doubleposting
Posted: Mon 21. Feb 2005, 12:17
by Rainer G
Pappnase wrote:hello
to get the id move the mouse over this icon in admin -> sitestructure, then you will see it.
Witzbold
I will script this in the template/left with coding like this:
{NAV_TABLE_COLUMN:
[PHP]
echo
$get_current_navid;
[/PHP]
integer}
I will use one template and not one for every subpage!
It will be look at this page from Pepe:
http://www.peperkorn-online.de/index.php
You understand me?
Posted: Wed 23. Feb 2005, 21:39
by Rainer G
anyone an idea?
Posted: Wed 23. Feb 2005, 23:53
by Karla
Posted: Thu 24. Feb 2005, 02:10
by Rainer G
Posted: Thu 3. Mar 2005, 10:40
by kiwix
Hi Rainer,
I used your code, but I thought it was a bit to difficult (and ugly
).
So I tried to optimize it a bit. On my intsallation it seams to word and you you haven't to do the check for every sub level of your structure.
Code: Select all
[PHP]
$id = $GLOBALS['content']['cat_id'];
$parent_id = $GLOBALS['content']['struct'][$id]['acat_struct'];
if ($id!=0) {
while ($parent_id != 0):
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
endwhile;
}
if ($id > 0) {
echo '{NAV_TABLE_COLUMN:'.$id.'}';
}
[/PHP]
Cheers
KiWiX
Posted: Thu 3. Mar 2005, 21:01
by Rainer G
Hi Kiwix!
Meanwhile i use my selfoptimized code:
Code: Select all
$id = $GLOBALS['content']['cat_id'];
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
While ($parent_id<>0){
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
}
if ($id > 0) {
echo '{NAV_TABLE_COLUMN:'.$id.'}';
}