[TYPO3-english] HMENU as if on other page

David Bruchmann typo3-en at bruchmann-web.de
Mon Jul 20 14:10:10 CEST 2009


----- 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