[TYPO3] Partial menu generation

Jeppe Vesterbæk jhve02 at control.aau.dk
Thu Feb 16 00:23:34 CET 2006


Suppose I have a tree structure like this:

- Page ID=1 (level 1)
- Page ID=2 (level 1)
    - Page ID=3 (level 2)
    - Page ID=4 (level 2)
          -Page ID=5 (level 3)
          -Page ID=6 (level 3)
-Page ID=3 (level 1)

How do I dynamically generate a new menu given a page ID? Say we want a 
menu with ID=4 as pageroot, this menu shold look like (example 1):
- Page ID=4 (level 1)
    -Page ID=5 (level 2)
    -Page ID=6 (level 2)

or if menu root is ID=2 and selected page is ID=6, show this menu 
(example 2):
- Page ID=2 (level 1)
    - Page ID=3 (level 2)
    - Page ID=4 (level 2)
          -Page ID=5 (level 3)
          -Page ID=6 (level 3)

I'm doing this way:

temp.menu_doc.special = list
temp.menu_doc.special.value.insertData = 1


[globalVar = GP:menuentrylevel = 1]
[globalVar = GP:menuentrylevel = 2]
[globalVar = GP:menuentrylevel = 3]
[globalVar = GP:menuentrylevel = 4]

So, to generate my menu in (example 1), my query string looks like: 
To generate the menu in (exampe 2), my query string look like 

This solution DOES WORK! BUT,  it is not a nice solution because:
1) I need to know the entrylevel of the menuroot page
2) Quote TSREF p. 72: "NOTE: Don't set .entryLevel for a HMENU when 
using this option!"

But I need to set the entrylevel because (also from TSREF p. 72): "Also 
be aware that this selects pages for the first level in
the menu. Submenus by menuPbjects 2+ will be created as usual."

To sum up, what I want to do is the specify a page ID in the query 
string that defined the new "menuroot".


Jeppe Vesterbaek

More information about the TYPO3-english mailing list