TYPO3 : SimplePoll : 显示最后一个 [英] TYPO3 : SimplePoll : show the last

查看:32
本文介绍了TYPO3 : SimplePoll : 显示最后一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用 simplepoll.uid 在前端显示一个投票:

currently I'm using simplepoll.uid to show a Poll on the Frontend :

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 ?

is there a way to show automatically the last poll added to the storagePid instead of simplepoll.uid ?

推荐答案

可能是我的解决方案不起作用,因为扩展中可能没有 stdWrap 支持.然后你应该要求扩展作者在包装中构建(或通过拉取请求支持他).

It could be that my solution does not work as there might be no stdWrap support in the extension. Then you should ask the extension author to build in the wrapping (or support him with a pull request).

使用选择最高 uid 的 SQL 查询应该可以从上次创建的轮询中请求 uid.

Requesting the uid from the last created poll should be possible with an SQL query which selects the highest uid.

可以使用 CONTENT 对象在打字稿中完成 SQL 查询:

An SQL query can be done in typoscript with the CONTENT object:

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 子句来选择没有删除和隐藏的记录,因为这些记录会自动插入.

You need no WHERE clause to select no deleted and hidden records as these where inserted automatically.

注意在隐藏模式下创建民意调查,否则可能会选择不完整的民意调查.

Be aware to create polls in hidden mode otherwise an incomplete poll could be selected.

使用

<f:cObject typoscriptObjectPath="lib.poll.settings.simplepoll.uid.cObject" />

page.1 < lib.poll.settings.simplepoll.uid.cObject
page.1.wrap = <h1>poll = [|]</h1>

这篇关于TYPO3 : SimplePoll : 显示最后一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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