TYPO3 6.0:从FAL中的边框列渲染当前页面的图像

问题描述 投票:6回答:2

我有以下代码片段,但我无法使用。

COL3 = FILES
COL3 {
        references {
            table = tt_content
            uid = 14
            fieldName = image
        }
        renderObj = TEXT
        renderObj {
            data = file:current:publicUrl
            wrap = <img src="|">
        }
}

代码段目前可以使用,但是我想在当前页面上使用它,并且colPos =3。所以类似:

table = tt_content
select {
  where = colPos = 3
  orderBy = sorting
  languageField = sys_language_uid
}

感觉就像我已经尝试了几乎所有东西。

我非常感谢我所能提供的一切帮助...

谢谢很多!

typo3 typoscript
2个回答
4
投票

我假设select属性不适用于references。尝试将此解决方案(未经测试)与任何内容元素一起使用。

...
references {
    table = tt_content
    uid.data = uid
    fieldName = image
}

另一个想法:

COL3 = CONTENT
COL3 {
    table = tt_content
    select {
        where = colPos = 3
    }

    renderObj =  FILES
    renderObj {
            references {
                table = tt_content
                fieldName = image
            }
            renderObj = TEXT
            renderObj {
                data = file:current:publicUrl
                wrap = <img src="|">
            }
        }
    }

7
投票

对我来说听起来更好:

COL3 = CONTENT
COL3 {
    table = tt_content
    select {
        where = colPos = 3
    }

    renderObj =  FILES
    renderObj {
            references {
                table = tt_content
                fieldName = image
            }
            renderObj = IMAGE
            renderObj {
                file.import.data = file:current:publicUrl
            }
        }
    }
© www.soinside.com 2019 - 2024. All rights reserved.