[Typo3] SOLVED - HMENU of subpages on every page example

JoH info at cybercraft.de
Wed Nov 23 14:48:44 CET 2005


>> I need something user proof so when users add deeper levels of
>> hierarchy the menu will stay updated.
>
> Thanks to Christopher for the hint.
>
> #
> # SUBNAV - shows subpages to the current page
> #
> temp.subnav.text >
> temp.subnav.text = HMENU
> temp.subnav.text.entryLevel = 0
> temp.subnav.text.1 = TMENU
> temp.subnav.text.1.noBlur=1
> temp.subnav.text.1.NO.allWrap =  |*| · 
> [treeLevel = 1]
> temp.subnav.text.entryLevel = 1
> [treeLevel = 2]
> temp.subnav.text.entryLevel = 2
> [treeLevel = 3]
> temp.subnav.text.entryLevel = 3
> [treeLevel = 4]
> temp.subnav.text.entryLevel = 4
> [global]
>
> Add more levels as needed...
>
> A lot of people have asked for this in the past with no simple
> solutions posted so I hope this very simple solution helps someone
> else.

Well - maybe I am wrong, but AFAIK this is not necessary at all.
If you want to display subpages of the current page only, this should be the
default behaviour of HMENU.
So you could simply remove the entryLevel _and_ the conditions completely.

temp.subnav.text = HMENU
temp.subnav.text {
  1 = TMENU
  1.noBlur=1
  1.NO.allWrap =  |*| · 
}

another approach for relative startingpoints of HMENU is this one:

temp.subnav.text = HMENU
temp.subnav.text {
  special = directory
  special.value.data = leveleuid:-1
  1 = TMENU
  1.noBlur=1
  1.NO.allWrap =  |*| · 
}

"leveluid:-1" means subpages of the current page (should give you the same
result as the default HMENU)
Replace it with "leveluid:-2" and you will get supages of the parent page.
Replace it with "leveluid:-3" and you will get supages of the parents'
parent page ...
and so on.
Again no conditions.

Of course this will not work when the current page is on the root level (or
any other level lower than the value used for leveluid)
Therefor you might need a condition.

Try it and tell us if it worked.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list