"Normal" Action Links inside Content-Plugins?

Hi,

I have created a new Plugin, what is showing a Controller-Actions View-Fluid-Template.

When I am creating <f:link.action> links inside this template, they are are
generated like this:

http://neos.local/mycurrentpage
?–my_package-plugin_configurator_index%5B%40package%5D=my.package
&–my_package-plugin_configurator_index%5B%40controller%5D=testjson
&–my_package-plugin_configurator_index%5B%40action%5D=testjson
&–my_package-plugin_configurator_index%5B%40format%5D=json
&–my_package-plugin_configurator_index%5Bemail%5D=Blaaaaa
&–my_package-plugin_configurator_index%5Bname%5D=bluuuububbbbfdfdg

In my template: <f:link.action package=“My.Package” action=“testJson” controller=“TestJson” format=“json” arguments="{email: ‘Blaaaaa’, name: ‘bluuuububbbbfdfdg’}" > JSON </f:link.action>


I want to create a normal action-link-route, like “http://neos.local/mysuperapi/getdata”.

I have created this route (and i can visit this route by manual typing):

name: ‘TestRoute MySuperApi’
uriPattern: ‘mysuperapi/{@action}’
defaults:
@package’: ‘My.OtherPackage’
@controller’: ‘MySuperApi’
@format’: ‘json’

But when I use
<f:link.action package=“My.OtherPackage” action=“getData” controller=“MySuperApi” format=“json” arguments="{email: ‘Blaaaaa’, name: ‘bluuuububbbbfdfdg’}" > JSON </f:link.action>
it will create a Link to the current page and with these “plugin prefix arguments”…

THE ISSUE IS, that when I call:

http://neos.local/mycurrentpage?--my_package-plugin_configurator_index[%40package]=my.otherpackage&--my_package-plugin_configurator_index[%40controller]=mysuperapi&--my_package-plugin_configurator_index[%40action]=getdata&--my_package-plugin_configurator_index[%40format]=json&--my_package-plugin_configurator_index[email]=Blaaaaa&--my_package-plugin_configurator_index[name]=bluuuububbbbfdfdg

then I get a JSON what is wrapped by the HTML-Fluid-LAYOUT.

But when I call “http://neos.local/mysuperapi/getdata” manually, then I get only the JSON, without surrounding HTML-LAYOUT…

Soo, what have I to do, to create “normal” Action-Links routes like “http://neos.local/mysuperapi/getdata

Ayy, after more testing saw, that useParentRequest=“true” will bring me the URL what I was looking for!

Before, I still got some routing-errors when using useParentRequest=“true”,
I will have to clean-up my routing configurations…

The plugin routes is (in terms of Routing in Flow) a argument, being passed on to the request.
So to create nice form your plugin, you need configurations similar to this (from this link, modified with new namespace)

-
  name: 'Nice urls for my plugin'
  uriPattern:    '{node}/getdata'
  defaults:
    '@package':    'Neos.Neos'
    '@controller': 'Frontend\Node'
    '@action':     'show'
    '@format': 'html'
    '--my_package-plugin_configurator_index':
      '@package': 'My.OtherPackage'
      '@controller': 'MySuperApi'
      '@action': 'getData'
      '@format': 'json'
  routeParts:
    node:
      handler:    Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface
  appendExceedingArguments: FALSE