[TYPO3-english] HMENU as if on other page

Tyler Kraft tyler.kraft at netefficiency.co.uk
Mon Jul 20 14:28:43 CEST 2009


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.

T







David Bruchmann wrote:
> ----- Ursprüngliche Nachricht -----
> Von:        Tyler Kraft <tyler.kraft at netefficiency.co.uk>
> Gesendet:   Montag, 20. Juli 2009 10:41:13
> An:         typo3-english at lists.netfielders.de
> CC:
> Betreff:    Re: [TYPO3-english] HMENU as if on other page
> 
> Hy Tyler,
> 
>>
>> The client can then place the plugin on any page, at any depth on the 
>> site and in any place they want, and choose a category and the FE 
>> output will be a listing on events that are within the selected 
>> category and meet other specific conditions (all set via the page 
>> plugin). When clicking the link from the FE listing you are directed 
>> to one specific page and shown the event details. All instances of the 
>> plugin go to this one page. In the link we pass a get variable that 
>> says what the previous page id that you just came from is.
> 
> backpid is given by many extensions and a wellknown parameter. In your 
> case it's perhaps differing because its toppid and not a real 
> history.back() like you can call with JavaScript. Nevertheless in your 
> extension you're free to define that parameter.
> 
>>
>> So based upon this get variable for the last page id all the 
>> navigation on the site has to reflect and be the same as if you were 
>> on the previous page. For the top navigation this can be easily 
>> accomplished using some conditions in the TS. For the breadcrumb 
>> navigation this can be accomplished with a simple php function. The 
>> part that I'm at a loss to mimic is the left hand navigation. The Ts 
>> for the left hand menu is below, and it is in a works 100% atm.
> 
> In the lefthand navi you want to hide the last point from the menu-array 
> depending on your extension. But also the params like itemStates have to 
> be changed.
> So the easiest and most reasonable way is to implement a userfunction 
> that ignores the current pagemenu if the plugin is inserted (and perhaps 
> if the parameter backpid is given).
> Then you  create a second HMENU inside PHP with the pid of the parent 
> page and pass the resulting array to your TS-Menu.
> Normally all your queries can be done even without backpid as parameter 
> because you can test everything you want inside php and the parameter 
> backpid reflects no user-choice but a hirarchical aspect.
> 
> Your TS-Menu has nothing special, but doing like I described you never 
> need any conditions or other special things, just include your 
> php-function ;-)
> 
> Best Regards
> David
> 


More information about the TYPO3-english mailing list