[TYPO3-mvc] A way to allow multiple Plugins on the same page

Henjo Hoeksma me at henjohoeksma.nl
Thu Nov 17 14:50:23 CET 2011


HI Tim,

did you see: http://forge.typo3.org/issues/31322

Adding tx_yourplugin.mvc.callDefaultActionIfActionCantBeResolved = 1 in the
setup.txt resolves the issue.

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Thu, Nov 17, 2011 at 13:46, Tim Schoch | GSTALTIG <tim.schoch at gstaltig.ch
> wrote:

> Hello List
>
> I found a simple workaround to allow multiple Plugin instances on the same
> page in combination with FlexForms switchableControllerActions.
> It works in simple environments where *only one* plugin needs to change
> actions. (the rest will allways show the default action)
> Basically I created an extenden RequestBuilder where I catch the «not
> allowed by this plugin» Exception.
> In that case I redirect to the default action of the plugin set in the
> FlexForm.
>
> You can find the PHP code here: http://pastebin.com/YrwWBuF0
> and the TS code here: http://pastebin.com/Gn08KMN0
>
> In our case we have one instance of the same plugin showing a list of
> all multiform steps and an other instance displaying the form itself.
>
> This method has its drawbacks of course, as it alters the behaviour for
> all extbase extensions.
> (You could minimize this by placing the TypoScript directly on the page
> with your Plugin)
> And it only allows one action to be changed at the time. It's not possible
> to show «fooAction» on plugin «A» and «barAction» on plugin «B».
>
> But it has some advantages too (o'rly?) as you can exchange arguments
> easely. Haven't testet it, but probably you could even make the controller
> a singleton and use the same instance for all plugins. I've seen some
> threads on this topic but no solution yet - so I figured I'd post it.
> Let me hear if this was helpfull for you.
>
> Tim
> _______________________________________________
> 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