Get the current site structure level
Get the current site structure level
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}
{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}
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
Try {NAV_LIST}, now available in the dev-release.
http://www.phpwcms.de/forum/viewtopic.php?p=32037#32037
http://www.phpwcms.de/forum/viewtopic.php?p=32037#32037
Ralf
I use the RC4 , the dev only for testing.
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
WitzboldPappnase wrote:hello
to get the id move the mouse over this icon in admin -> sitestructure, then you will see it.
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?
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
anyone an idea?
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
With your help i have this written (it's not a good code, but it runs how i will):
And for every additional sub structure, add this lines:
Code: Select all
[PHP]
$id = $GLOBALS['content']['cat_id'];
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
if ($id==0) {$top_id = $id;} // Home
elseif ($parent_id==0) {$top_id = $id;} // Sub 1
else {
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
if ($parent_id==0) {$top_id=$id;} // Sub 2
else {
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
if ($parent_id==0) {$top_id=$id;} // Sub 3
else {
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
if ($parent_id==0) {$top_id=$id;} // Sub 4
}
// Add here next
}
}
//echo "Top: ".$top_id." ID: ".$id." Parent: ".$parent_id;
if ($top_id > 0) {echo '{NAV_TABLE_COLUMN:'.$top_id.'}';}
[/PHP]
Code: Select all
else {
$id=$parent_id;
$parent_id=$GLOBALS['content']['struct'][$id]['acat_struct'];
if ($parent_id==0) {$top_id=$id;} // Sub 4
}
// Add here next
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
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.
Cheers
KiWiX
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]
KiWiX
Hi Kiwix!
Meanwhile i use my selfoptimized code:
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.'}';
}
Rainer G. aus H.
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de
http://www.BunteReisebilder.de
My phpWCMS-projects:
http://www.gnuelps.de
http://qvpage.gnuelps.de