簡體   English   中英

TYPO3流體變量

[英]TYPO3 fluid variables

我將TYPO3從7.6升級到8.6。 現在,我無法通過style.content.get設置變量,我的根模板加載了fluid_styled_content。 一些來源:

page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

   variables {
        contentMain < styles.content.get
        contentMain.select.where = colPos = 0
        contentnew < styles.content.get
        contentnew.select.where = colPos = 1
        contentkat < styles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}

顯示變量:

<f:format.raw> {contentMain} </f:format.raw>
<f:format.raw> {contentnew} </f:format.raw>
<f:format.raw> {contentkat} </f:format.raw>
<f:format.raw> {test} </f:format.raw>

styles.content.get是在ext:fluid_styled_content styles.content.get定義的,但是很晚,因此大多數副本都是空的。 引用不是解決方案,因為對colPos的修改將應用於所有引用。

目前,最好的解決方案似乎是在TS中盡早定義styles.content.get:

styles.content.get = CONTENT 
styles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}

但由於它是一個自己的定義,因此我將其重命名為temp.content.get因此可以將其標識為我自己的版本(如果全局定義發生更改,請不要混淆)

TYPO3 8.6中有一個錯誤: https : //forge.typo3.org/issues/80044

在將styles.content.get分配給variables之前,請添加以下內容: <INCLUDE_TYPOSCRIPT: source="FILE:EXT:frontend/ext_typoscript_setup.txt">然后,您可以像以前一樣使用它。

已解決感謝伯恩德! 解決了這個問題。 這里是一個完整的例子:

mystyles.content.get = CONTENT 
mystyles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}


page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

    variables {
        contentMain < mystyles.content.get
        contentMain.select.where = colPos = 0
        contentnew < mystyles.content.get
        contentnew.select.where = colPos = 1
        contentkat < mystyles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM