Search code examples
typo3extbasetypo3-extensions

TYPO3: Communicate between two plugins


I have made two plugins, one will call listAction and display a list of records and the other one will call viewAction to display the selected record.

How can I display a page where I have created the show plugin with the uid of the record I want to display?

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
  'Vendor.Extension',
  'List',
  [
      \Vendor\Extension\Controller\Controller::class => 'list',
  ],
  [
      \Vendor\Extension\Controller\Controller::class => '',
  ]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
  'Vendor.Extension',
  'View',
  [
      \Vendor\Extension\Controller\Controller::class => 'show',
  ],
  [
      \Vendor\Extension\Controller\Controller::class => '',
  ]
);

What I need to do is kind of what the extension News does but the way is done in that extension is deprecated and TYPO3 says that we have to do it using multiple plugins now.

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Deprecation-89463-SwitchableControllerActions.html


Solution

  • The "communication" is not between your plugins, but via the page request. Following a "more/detail"-link in your list will reload the page with additional parameters.

    Here, f:link.action is, what you're looking for. This ViewHelper enables you to link to a specified extension (extensionName), plugin (pluginName), controller (controller) and action (action).