I do have a second typeNum to be render data via ajax call. I like to overwrite the chosen template on this, to be able to render the site for the case the user disabled JS. Is it possible or do I have to extend the PageProvider for this?
I had a quick look into the PageProvider class. There is a function called getTemplatePathAndFilename, which I think would get the template based on the database entry. Is it enough to check for a typoscript setting here and take it if present?
So... there are several ways to achieve that. The most easiest and straight forward way (imho) is to create a controller and a template for it. In the typoscript configuration you use the Name of the Controller you like to get rendered as the PluginName.
For Example Ajax for using the AjaxController and the TemplatePath Ajax.
contentPage = PAGE
contentPage {
plugin.tx_myproviderext.settings.template >
typeNum = 12358
config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
debug = 0
}
5 = USER
5.userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
5.extensionName = Fluidpages
5.vendorName = FluidTYPO3
5.pluginName = Ajax
}
Or you extend the PageProvider from fluidpages in your own ProviderExtension and overwrite the getTemplatePathAndFilename function with your own implementation for example to configure the path by using typoscript.