I have an extension containing a action for an ajax call, which returns a json string. There is also a plugin inserted on a specific page for the user input. The plugin has some settings (via flexform), which I want to get at the ajax call, but I have no idea how.
ajaxCall = PAGE
ajaxCall {
typeNum = 1000
config {
disableAllHeaderCode = 1
metaCharset = UTF-8
no_cache = 1
debug = 0
}
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = Vendor
pluginName = SomePlugin
extensionName = SomeExtension
controller = MyController
action = ajax
switchableControllerActions {
MyController {
1 = ajax
}
}
}
}
I see two possibilities to solve your problem:
tt_content
) in the parameters of your call to the controller so the controller can read that record and get the data.or
CONTENT
object in your typoscript.)Thanks, I tried something like 2. but I've got the problem, that I get also the headline and the wrap, which is unpractical for a json output
....
#page Type 1000
10 = CONTENT
10 {
table = tt_content
select {
where = list_type="someextension_someplugin"
}
...
That is a perfect use case for https://extensions.typo3.org/extension/typoscript_rendering/ Create a link to the action you want to call via Ajax using the delivered view helper and your action renders exactly as expected (including flexform content being respected).