[TYPO3-mvc] Reuse arguments in different action

Stephan Schuler Stephan.Schuler at netlogix.de
Mon Dec 1 18:59:44 CET 2014


Hey there.

That only works in a very limited environment.

As long as you have one plugin showing the "search options" in one section of the page and another plugin showing only the "results list" in another section, having a common argument namespace gives you exactly what you want.

As soon as you change one of those plugins to use switchable controller actions (usually you make the "results" plugin responsible for both, the "listAction" as well as the "showAction" for detailed information) the whole thing crashes because the "action" argument is a GET argument, too.
So when linking form the listAction to the showAction, not only the "results" plugin gets called to render the showAction. The "search form" receives the very same command (because it listens to the same argument namespace) which results in an exception because of not having switchable controller actions configured properly.

You could have a third plugin for the showAction on a very different page. That definitively works. But you need to be aware of that and create your plugin and page structure accordingly.

Regards,



Stephan Schuler
Web-Entwickler | netlogix Media

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Web: media.netlogix.de




netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Web: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Jonas Eberle
Gesendet: Montag, 1. Dezember 2014 12:53
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] Reuse arguments in different action

Liebe Anja,

Tausend Dank!
That's it!

Regards,
Jonas


Am 01.12.2014 um 12:42 schrieb Anja Leichsenring:
> Hi Jonas,
>
> you can share the namespace between both plugins. Both will then
> receive all the parameters from the other one and you can act as if
> they are not two plugins, but one.
>
> How this works, is described in the wiki:
> http://wiki.typo3.org/Configurable_Plugin_Namespaces
>
> Good luck!
> Anja
>
> On 01.12.2014 12:32, Jonas Eberle wrote:
>> Hello,
>>
>> this is a common pattern that I have yet solved in different (hacky,
>> workaroundy) ways with Extbase. I'd like to hear your oppinions:
>>
>> I have 1 plugin that represents a search form and 1 that represents
>> the result list. Both need to be aware of submitted search parameters
>> (the list because it needs to apply constraints and the search form
>> because it needs to reflect current search constraints by prefilling fields).
>> They need to be separate because they could be presented in different
>> parts of one page or even solo.
>>
>> How do you 'share' those arguments between 2 different plugins and
>> their respective actions?
>>
>>
>> Here is how I did it in recent projects:
>> 1) Define a HttpParametersService (just to keep it separate from the
>> controller) that does some t3lib_div::_GP($key) to get the variables.
>> 2) Just use $_REQUEST directly in the controller to get the key.
>> 3) Use AJAX to drive the list (some projects need to be usable
>> without JavaScript, so this is not always an option)
>>
>> Both seems awkward and non-Extbase-evangelical. Everytime I do this I
>> crawl the web to find any more elegant solutions...
>>
>> Any suggestions?
>>
>>
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4m
> vc


--
Neu: Portal Region Stuttgart - www.region-stuttgart.de
Neu: emobil-in-bw.de
Neukunde: Statistisches Landesamt BaWü
--------------------------------
d-mind bei Facebook: http://www.facebook.com/werbeagentur.internetagentur.stuttgart
--------------------------------
d-mind
Fuchs/Weiß/Strobel GbR
Mörikestraße 69
70199 Stuttgart
Tel.: +49 711 280481-1 (Durchwahl: -18)
Fax: +49 711 2804813
Inhaber: Jens Fuchs, Michael Weiß, Jens Strobel www.d-mind.de

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list