typo3 - TYPO3 : SimplePoll : 显示最后一个
问题描述
目前我正在使用simplepoll.uid
在前端显示民意调查:
lib.poll = USER
lib.poll {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = Simplepoll
pluginName = Polllisting
vendorName = Pixelink
settings =< plugin.tx_simplepoll.settings
settings {
simplepoll.uid = 13 // this is the ID of the Poll to show
}
persistence =< plugin.tx_news.persistence
view =< plugin.tx_news.view
}
有没有办法自动显示添加到 storagePid 而不是最后一次投票simplepoll.uid
?
解决方案
可能是我的解决方案不起作用stdWrap
,因为扩展中可能没有支持。然后您应该要求扩展作者构建包装(或通过拉取请求支持他)。
应该可以使用选择最高 uid 的 SQL 查询从上次创建的轮询中请求 uid。
可以使用CONTENT
对象以印刷方式完成 SQL 查询:
lib.poll {
settings {
simplepoll.uid.cObject = CONTENT
simplepoll.uid.cObject {
table = tx_poll... // get the exact page name
select {
selectFields = uid
pidInList = ??? // insert storage page of your polls
orderBy = uid DESC
max = 1
}
renderObj = TEXT
renderObj. field = uid
}
}
}
您不需要WHERE
子句来选择不删除和隐藏的记录,因为这些记录是自动插入的。
请注意在隐藏模式下创建投票,否则可能会选择不完整的投票。
测试
<f:cObject typoscriptObjectPath="lib.poll.settings.simplepoll.uid.cObject" />
或者
page.1 < lib.poll.settings.simplepoll.uid.cObject
page.1.wrap = <h1>poll = [|]</h1>
推荐阅读
- python - 您可以使用 3 个单独的 1D numpy 数组来使用矢量化来操作 3D 数组吗?
- python-imaging-library - 我已经安装了枕头,但无法将其导入 python shell
- python - 在 column1 中查找确切的单元格值并将 column2 的值连接到新列中
- javascript - Chrome 扩展程序:如何让网页访问我的内容脚本定义的功能?
- python - 在 Anaconda3 中安装 pysystemtrade
- swift - 在 SwiftUI 文本编辑器中设置光标位置
- html - Bootstrap:折叠手风琴不起作用
- reactjs - 微软 OCR-Form-Tools 项目 v2.0-GA 版本中的 yarn start 失败
- python-3.x - 我收到“AttributeError:‘str’对象没有属性
- python - ZeroMQ RADIO 套接字发送没有设置组的选项