TYPO3 Ajax 页面配置 [英] TYPO3 Ajax Page Configuration

查看:26
本文介绍了TYPO3 Ajax 页面配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从 TYPO3 中的 Ajax 页面中删除 CSS Styled conted 标题输出?

How can I remove the CSS Styled conted header output from a Ajax Page in TYPO3?

这是我的打字稿:

ajax = PAGE
ajax {
  typeNum = 1234
  # this solution is working, but then I don't have flexform values
  # 10 < tt_content.list.20.myextension_pi1

  10 < styles.content.get
  10 {
    select.where = colpos = 0
    select.andWhere = list_type='myextension_pi1'     
  }

  config {
    disableAllHeaderCode = 1
    additionalHeaders = Content-type:application/json
    xhtml_cleaning = 0
    admPanel = 0
    debug = 0
    no_cache = 1
  }
}

这是我的 Ajax 结果 - Hello World 是 tt_content 标头:

This is my Ajax Result - Hello World is tt_content header:

<h2 class="csc-firstHeader">Hello World</h2>{"valid":false}

我已经尝试过但没有成功:

I tried already without success:

lib.stdheader > 
lib.header >

这将影响所有页面类型,对于标准输出,我想保留 tt_content 标题输出.

And this will affect ALL page types, and for standard output I want to keep tt_content header output.

推荐答案

你不应该放置包含插件的 tt_content 元素,而是插件本身,比如:

You should not place tt_content element containing the plugin, but plugin itself, like:

ajax = PAGE
ajax {
  typeNum = 1234

  10 < plugin.myextension_pi1     

  config {
    disableAllHeaderCode = 1
    additionalHeaders = Content-type:application/json
    xhtml_cleaning = 0
    admPanel = 0
    debug = 0
    no_cache = 1
  }
}

另见类似问题

在这种情况下,您不需要修改 CSC.

You don't need to modify CSC in this case.

当然,在这种情况下,您需要通过 TS 配置您的扩展(最好带有将 TS 配置与 FlexForm 合并的选项,像这样)

Of course in such case you need to make your extension configurable via TS (preferably with option for merging TS config with FlexForm, like this)

替代方案:

  • 您还可以创建一个新页面(我们将其命名为 Voucher page) - 将 tt_conent 和您的 flexform 放在那里.
  • 获取它的 uid(假设它是 123)并将其添加到 ajax 链接,即:index.php?id=123&type=1234
  • 在页面上创建空的 TypoScript 模板(不是 root!)并在 Settings 字段中从 CSC 中删除所有格式(如您所示)

  • You can also create a new page (let's name it Voucher page) - put the tt_conent with your flexform there.
  • Get its uid (let's say it's 123) and add it to ajax link ie.: index.php?id=123&type=1234
  • At the page create empty TypoScript template (not root!) and in Settings field remove all formattings from CSC (as you showed us)

lib.stdheader > 
lib.header >
etc...

您还可以使用 TypoScript 条件 来清除 CSC仅在给定页面上,即.

You can also use TypoScript conditions for clearing CSC on given pages only ie.

[globalVar = TSFE:id = 123]
    lib.stdheader > 
    lib.header >
[end]

或仅用于 type 参数(我在某处读到它有一个错误,但没有确认,所以它应该也能工作):

or for type parameter only (I read somewhere that there was a bug with it, but not confirmed, so it should work as well):

[globalVar = GP:type = 1234]
    lib.stdheader > 
    lib.header >
[end]

这篇关于TYPO3 Ajax 页面配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆