我使用下面的typoscript,只有图片没有包裹在<img src="|" class="tip-image" alt="">
中,它只生成图片网址。 Out如下所示。我错了什么?
tipmenu = HMENU
tipmenu.special = directory
tipmenu.special.value = 8
tipmenu {
1 = TMENU
1 {
expAll = 1
wrap = <div class="left_links">|</div>
NO {
stdWrap.cObject = COA
stdWrap.cObject {
10 = FILES
10 {
references {
data = levelmedia:-1, slide
}
renderObj = COA
renderObj {
10 = IMG_RESOURCE
10 {
file.import.data = file:current:publicUrl
file.maxW = 50
file.maxH = 50
}
}
}
10.wrap = <img src="|" class="tip-image" alt="">
20 = TEXT
20.field = title
20.wrap = <span class="tip-title">|</span>
30 = TEXT
30.field = subtitle
30.wrap = <span class="tip-subtitle">|</span>
}
}
}
}
特此是html输出:
<div class="left_links">
<a href="tips/verhalen-van-klanten/">
fileadmin/_processed_/csm_klanten_e92ee310e0.png
<span class="tip-title">Verhalen van klanten</span>
<span class="tip-subtitle">Wat vind jij?</span>
</a>
</div>
答案 0 :(得分:0)
FILES没有换行。在stdWrap中使用你的包裹。
10.stdWrap.wrap = <img src="|" class="tip-image" alt="">
一些提示:
也许你应该在Files中添加一个maxItems = 1。如果编辑器插入两个或更多图像,则输出将如下所示:<img src="image1.jpgimage2jpgimage3.jpg" class="tip-image" alt="">
您不需要COA。除非有COA的原因,否则直接使用IMG_RESOURCE。
renderObj = IMG_RESOURCE
renderObj {
file.import.data = file:current:publicUrl
file.maxW = 50
file.maxH = 50
}