Is there something like {NAV_ROW:PARENT}?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
hendrik
Posts: 66
Joined: Thu 9. Dec 2004, 21:18
Location: Berlin
Contact:

Is there something like {NAV_ROW:PARENT}?

Post by hendrik »

hola

Can anybody help me?
I'm looking for something like {NAV_ROW:PARENT} or a workaround (ok, I'm no php-programmer),
because {NAV_ROW:CURRENT} only shows the next sublevel items, but not the (sister/brother-)items of the current structure-level.
I know about {NAV_ROW:ID}, but isn't there a better solution which is avoiding several templates?

do you know what I mean??!
:?:

thank you!
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

this must be what your are looking for!

http://www.phpwcms.de/forum/viewtopic.php?p=32052#32052
http://www.studmed.dk Portal for doctors and medical students in Denmark
hendrik
Posts: 66
Joined: Thu 9. Dec 2004, 21:18
Location: Berlin
Contact:

Post by hendrik »

Thank you Frold, the {MY_LEVEL_NAV} is very good (if not sophisticated :!: ), but it gives back more information than needed in my case.
Is there a way to change the code to only get the items of the actual level without the items of the parent levels?

Also, {MY_LEVEL_NAV} doesn't display images when used like {IMAGE:blumenth/blume2.jpg} in the admin-structure instead of text.
(I'm using a graphical thumbnail-menue with this)
Can this be improoved?!
CodexX
Posts: 27
Joined: Wed 6. Oct 2004, 00:14
Location: Germany

Post by CodexX »

I need something very similar like hendrik.
The problem with MY_LEVEL_NAV is that it gives the elements of all levels. I do only need the elements of the current level.

Home
-Main1
-Main2
--Sub1
--Sub2
--Sub3
-Main3

If i click on Main2 I'm redirected to Sub1 and now the menu should look like
Sub1 | Sub2 | Sub3
and nothing else.

I do only have a little knowledge in PHP so modified I MY_LEVEL_NAV and tried the following:

Code: Select all

        $LevelDone = 0;
        $LEVEL_IDM = array_reverse($LEVEL_ID);

        foreach($LEVEL_IDM as $depth => $thisStructureID) {

                if ($LevelDone<2)
                {

                $template_default["nav_row"]["before"]  = '<font class="levelClass1">';
                $complexNav .= nav_level_row($thisStructureID,0);
                $LevelDone++;

                }
        }


        $content["all"] = str_replace('{MY_LEVEL_NAVY}', $complexNav, $content["all"]);
It works somehow (;)) but I think this is really crapy. Does someone have 10 minutes to make a clean code for that purpose?

Thanks a lot in advance.
Post Reply