Connecting backend modules across TYPO3 9 extensions

Hey folks, I’m working on a TYPO3 9 project and I’ve got two different extensions, each with its own backend module. I’ve set them up using ExtensionUtility::registerModule(). Now I’m trying to create a link from one module to the other, but I’m stuck.

I’ve tried a couple of things in FLUID:

<f:link.action action="doSomething" controller="MyController" extensionName="myExt">Click here</f:link.action>

<f:be.link route="/myext/SomeController/">Click here</f:be.link>

But neither of these worked. I’m not sure if I’m using the right approach or if there’s a better way to do this. Has anyone dealt with this before? What’s the best method to link between backend modules in different extensions? Any help would be awesome!

Have you considered using the ModuleUrlBuilder class? It’s specifically designed for generating URLs to backend modules in TYPO3 9. Here’s how you might use it:

use TYPO3\CMS\Backend\Routing\UriBuilder;
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uri = $uriBuilder->buildUriFromRoute('module_name', ['id' => $someId]);

You can then assign this URI to your Fluid template and use it in a link. This approach is more robust and flexible, especially when dealing with modules in different extensions. It also allows you to pass parameters easily.

Remember to replace ‘module_name’ with the actual name of your target module as registered in TYPO3. This method should work reliably across different extensions.

hey there, Finn! have you tried using the UriBuilder class? it’s pretty handy for generating backend URLs. something like this might work:

$uriBuilder = $this->objectManager->get(UriBuilder::class);
$uri = $uriBuilder->buildUriFromRoute('your_module_name');

given that, you could then use that URI in your fluid template. what do you think? worth a shot?

hey Finn, have u tried using the BackendUtility class? it’s pretty useful for generating backend URLs. something like this might work:

use TYPO3\CMS\Backend\Utility\BackendUtility;
$url = BackendUtility::getModuleUrl('your_module_name');

then u can use that URL in ur fluid template. worth giving it a go?