TYPO3 javascript页脚与typoscript,WHERE子句打破SELECT功能

时间:2018-02-05 10:08:58

标签: database select typo3 typoscript

我有一个奇怪的页面结构,子页面的colPos = 0被用作其父页面的内容......这些页面的动画需要父页面页脚中的代码,所以我添加了字段tx_add_animation_code在表tt_content中,需要收集此代码。

SETUP.TXT:

# footer script
page.footerData {
    # collect subpages
    5 = LOAD_REGISTER
    5 {
        pageIds.cObject = CONTENT
        pageIds.cObject {
            table = pages
            select {
                pidInList = this
                recursive = 0
                selectFields = uid
                where = {#no_search}=0
            }
            renderObj = TEXT
            renderObj {
                field = uid
                required = 1
                wrap = |,
            }
        }
    }
    # open javascript
    10 = TEXT
    10.value (
        <script type="text/javascript">

    )
    # test id collection
    25 = TEXT
    25 {
        data = register:pageIds
        noTrimWrap (
|
/* subpage Ids: | */
|
        )
    }
    # collect animation code from CE's on subpages
    20 = CONTENT
    20 {
        table = tt_content
        select {
            pidInList.data = register:pageIds
            # THIS LINE BREAKS FUNCTIONALITY
            where = {#colPos}=0
        }
        renderObj = COA
        renderObj {
            10 = TEXT
            10.stdWrap.field = tx_add_animation_code
        }
        if {
            value = pagets__homepage,pagets__onepage
            isInList.data = TSFE:page|backend_layout
        }
    }
    # close javascript
    30 = TEXT
    30.value (

        </script>
    )
    90 = RESTORE_REGISTER
}

where = {#colPos}=0打破了功能,如果我不包含它,当然,该字段是从所有内容元素中收集的......

问题是什么?

1 个答案:

答案 0 :(得分:1)

请确保子页面上有一些内容元素,其中colPos = 0。请注意,像gridelements或其他multicol扩展的一些扩展会将他们的childelements的colPos设置为负值,如-67,所以他们不再匹配select语句。