[TYPO3-english] HMENU as if on other page

Christopher Torgalson bedlamhotel at gmail.com
Mon Jul 20 18:08:54 CEST 2009


Hi,

On Mon, Jul 20, 2009 at 5:28 AM, Tyler
Kraft<tyler.kraft at netefficiency.co.uk> wrote:
> Hi David,
>
> No it's the same idea as always - it's back pid (at the bottom of the
> rootline, not the top)
>
> Forgive me if this seems ridiculous but I still don't think we're
> talking about the same thing here. I don't want to hide the last menu
> point/item at all - in some cases it's not even the same menu at all. I
> want to generate a menu that is not at all where the current page is,
> but with a make believe page.
>
> If I have this page tree structure in the BE
>
> home
>        |- sub a
>        |       |- sub aa
>        |               |-sub aaa
>        |                       |-sub aaa
>        |-sub b
>        |       |-sub bb
>        |
>        |-sub c
>        |       |- sub cc
>        |               |-sub ccc
>        |-sub d
>
> I need to generate the menu as if I was on page sub cc or page sub bbb
> (as defined with &backpid=XX) when I'm actually on page sub d (and the
> page structure is more complicated than just this simple example.) So my
> problem is that I don't really know where the start of the menu is ever
> going to be, and I don't know what the parent page is going to be, and I
> don't know how deep the menu will ever be. All I know is the page that I
> came from and nothing more. So from my point of view I have to build the
> menu as if in reverse, with no directions so to speak - just starting at
> the final destination ;-)
>
> I find what you're suggesting impossible to do as I don't know PHP -
> hence the idea that it would be very very handy to have this property
> included into the core - so that one could make use of it very easily
> with out having to write php function (or in my case get a php function
> written) everytime there was something slightly more tricky to try to
> accomplish.
>
> If some can give me the php that would take a variable of a give page
> and generate the page structure (as you describe) for the complete tree
> above then that would probably be exactly what I want, and I'd be very
> grateful.


I have the feeling you've already rejected what I'm about to suggest,
but I couldn't find it in my quick skim over the thread. But since
you've already got your GET parameter giving the uid of the page whose
menu you need to generate, can't you just do something like this?

temp.lhnav = HMENU
temp.lhnav {
    special = directory
    special.value.data = GPvar:backpid

    1 { ... }
    2 < .1
    3 < .1
    4 < .1
    5 < .1
    6 < .1
    7 < .1
    8 < .1
    9 < .1
}

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list