[TYPO3-mvc] multiple instances of the same plugin on the same page
mario chiari
m at mariochiari.net
Tue Jul 26 17:20:05 CEST 2011
Hello Pankaj,
thanks for your reply.
It seems perfect.
I'll let you know.
Best wishes
mario
On Tue, 2011-07-26 at 18:52 +0530, Pankaj Lele wrote:
> Hello Mario,
>
> > Do I miss something, or I need to avoid multiple instances of the same
> > plugin into the same page?
>
> Yes, generally avoid multiple instances of same plugin on same page. You
> can have a page for list view and another page for the show view.
>
> But if you are really stuck with your project and deadline and you
> really really want to have those plugins on same page then put your
> actions in 3 different plugin namespaces by adding plugins in the
> ext_tables.php and configure controller->actions for each in
> ext_localconf.php. e.g.
>
> ext_tables.php:
>
> Tx_Extbase_Utility_Extension::registerPlugin(
> $_EXTKEY,
> 'MyPluginInstanceOne',
> 'My Plugin Instance one'
> );
> Tx_Extbase_Utility_Extension::registerPlugin(
> $_EXTKEY,
> 'MyPluginInstanceTwo',
> 'My Plugin Instance Two'
> );
> Tx_Extbase_Utility_Extension::registerPlugin(
> $_EXTKEY,
> 'MyPluginInstanceThree',
> 'My Plugin Instance three'
> );
>
> ext_localconf.php:
>
> Tx_Extbase_Utility_Extension::configurePlugin(
> $_EXTKEY,
> 'MyPluginInstanceOne',
> array(
> 'YourController' => 'list,show',
> ),
> array(
> )
> );
>
> Tx_Extbase_Utility_Extension::configurePlugin(
> $_EXTKEY,
> 'MyPluginInstanceTwo',
> array(
> 'YourController' => 'list,show',
> ),
> array(
> )
> );
>
> Tx_Extbase_Utility_Extension::configurePlugin(
> $_EXTKEY,
> 'MyPluginInstanceThree',
> array(
> 'YourController' => 'list,show',
> ),
> array(
> )
> );
>
> Then with <f:link.action> specify additional argument to target the link
> to particular pluginName only.
>
> <f:link.action action="show" arguments="{mydomain : mydomain}"
> pluginName="MyPluginInstanceOne">
> {mydomain.property}</f:link.action>
>
> This way the URL parameters won't affect other plugins.
>
> Hope this helps you :)
>
> -Pankaj
>
More information about the TYPO3-project-typo3v4mvc
mailing list