简体   繁体   English

如何通过 ajax 从 html 获得 typo3 表单框架

[英]How to get a typo3 form-framework form html via ajax

I've got an experimental project at work where I have to check whether or not it is practical to use Typo3 in a headless way, with most of the Typo3 stuff still working.我有一个实验项目在工作,我必须检查以无头方式使用 Typo3 是否可行,大多数 Typo3 的东西仍在工作。

For the Rest Api I'm using tx_rest to expose my endpoints.对于 Rest Api 我使用tx_rest来公开我的端点。

In particular I'm currently trying to get the rendered html of a form, which was created by a backend user, with the Typo3 form framework, via ajax.特别是,我目前正在尝试通过 ajax 使用 Typo3 表单框架获取由后端用户创建的表单的渲染 html。

Does anyone know of a way to retrieve only the rendered html form from Typo3?有谁知道从 Typo3 仅检索呈现的 html 表单的方法?

Does anyone know of a way to retrieve only the rendered html form from TYPO3?有谁知道从 TYPO3 中仅检索呈现的 html 表单的方法?

Create a new PAGE object with a custom number使用自定义编号创建一个新的PAGE object

formPage = PAGE
formPage.typeNum = 765

and set并设置

formPage.config {
    debug = 0
    disableAllHeaderCode = 1
    disablePrefixComment = 1
    xhtml_cleaning = none
    admPanel = 0
}

to prevent any other output and finally防止任何其他 output 最后

formPage.10 < styles.content.get

(or use any other setup to fetch your content, this is just an example, that will output all contents of the current page in colPos 0) (或使用任何其他设置来获取您的内容,这只是一个示例,它将 output 当前页面的所有内容在 colPos 0 中)

Opening your page with https://myhost.com/my/path/?type=765 will then render anything on the page without any additional markup, just the output of your page content (eg the form plugin, etc.).使用https://myhost.com/my/path/?type=765打开您的页面将在页面上呈现任何内容,而无需任何其他标记,只有页面内容的 output(例如表单插件等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM