我正在尝试在FILES对象中获取文件元数据:
我有一个内容对象来构建页面子页面的预告片。因为Levelmedia的继承在CONTENT-Object中对我不起作用,所以我使用ifEmpty构建了一个Fallback。这是我的TS:
lib.subpages = COA
lib.subpages {
10 = CONTENT
10 {
table = pages
select.where = nav_hide != 1 AND doktype IN (1,3,4)
renderObj = COA
renderObj {
stdWrap.wrap = <div class="grid-elem teaser"><div>|</div</div>
stdWrap.wrap.insertData = 1
stdWrap.innerWrap = |
10 = COA
10 {
10 = FILES
10{
references {
field = media
}
begin = 0
maxItems = 1
renderObj = COA
renderObj {
10 = IMAGE
10 {
file.import.data = file:current:publicUrl
file.crop.data = file:current:crop
file.cropVariant = subpages
altText.data = file:current:alternative
titleText.data = file:current:title
}
}
stdWrap.ifEmpty.cObject = COA
stdWrap.ifEmpty.cObject.10 = FILES
stdWrap.ifEmpty.cObject.10 {
references {
data = levelmedia:-1,slide
}
begin = 0
maxItems = 1
renderObj = COA
renderObj {
10 = IMAGE
10 {
file.import.data = file:current:publicUrl
file.crop.data = file:current:crop
file.cropVariant = subpages
altText.data = file:current:alternative
titleText.data = file:current:title
}
}
}
stdWrap.wrap.typolink.parameter.field = uid
stdWrap.wrap = <figure>|</figure>
}
}
20 = COA
20 {
10 = TEXT
10.wrap =<div class="category">|</div>
10.data = levelfield:1, title
20 = TEXT
20.wrap = <h3 class="teaser-title">|</h3>
20.stdWrap.wrap.typolink.parameter.field = uid
30 = TEXT
30.wrap = <p>|</p>
30.field = abstract
30.crop=150 | ... |1
}
20.wrap = <div class="teaser-content">|</div>
}
}
}
第一个FILES从页面的media-field获取图像,如果没有图像,则在ifEmpty-Tree中,我在根行中搜索图像。该解决方案为我提供了预期的页面树中的图像。但是只有在引用引用levelmedia的ifEmpty中的FILES才会传递特定文件的元数据。引用“媒体”的文件只给我文件,没有任何元数据。
有人在暗示我做错了什么吗?
答案 0 :(得分:0)
已解决:代替FILES-Object的reference子句中的centos:6
,它必须是field = media
通过这种修改,作物变体起作用了,我也获得了标题和替代文本。