![](/img/trans.png)
[英]Typo3 8.7.x / Extbase / Typoscript: How to set the storagePid for adding new custom object to tt_content (mm relation)
[英]Typo3 8.7.x / Extbase / Typoscript: How to remove the anchor wrap when using RECORDS
我正在使用扩展模板进行json输出。 我想按ID获取记录。
ajax = PAGE
ajax {
typeNum = 99
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
admPanel = 0
debug = 0
}
10 = RECORDS
10 {
tables = tt_content
source = 77
}
}
但是我的输出在想要的数据之前有一个锚链接:
<a id="c2"></a>{"errors":[],"messages":["some message"]}
如何删除
<a id="c2"></a>
如果使用RECORDS
对象,则将获得记录的默认呈现。 对于tt_content,可能包括每个元素之前包装的锚点。
如果需要自己的渲染,可以将CONTENT
对象与自己的renderObj
属性一起使用。
或者,您可以修改tt_content
记录的全局呈现(对于CSC,在打字稿中,对于FSC,在流体布局文件中),以跳过页面类型99的锚点。
感谢@Bernd Wilke,现在它正在使用以下代码
ajax = PAGE
ajax {
typeNum = 99
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
admPanel = 0
debug = 0
}
//not working, because it's not respect the storage
#10 < tt_content.list.20.myext_p1
10 = CONTENT
10 {
table = tt_content
renderObj = COA
renderObj {
10 < tt_content.list.20.myext_p1
}
}
}
当我正确时,使用此代码,它将从定义了ext模板的页面的页面中获取内容,并从插件复制渲染。 未注释的代码不起作用,因为它没有使用我插入具有定义的存储的插件的页面中的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.