我在使用dateUntil标记Stiemap中的链接时遇到问题。这是我的错字:
tt_content.menu.20.1 >
tt_content.menu.20.1 < tt_content.menu.20.7
tt_content.menu.20.1.1.wrap = <div class="menu_list_sitemap">|</div>
tt_content.menu.20.1.1.NO {
ATagBeforeWrap = 0
doNotLinkIt = 1
stdWrap.htmlSpecialChars = 0
stdWrap.cObject = COA
stdWrap.cObject {
# Untertitel verlinken
10 = TEXT
10 {
field = subtitle
wrap = |
stdWrap.cObject = COA
stdWrap.cObject {
20 = IMAGE
20.file.import.field = media
20.file.import = uploads/media/
20.file.import.listNum = 0
20.wrap = |
30 = TEXT
30.field = title
30.wrap = <div class="txt">|</div>
40 = TEXT
40.if.isPositive.dataWrap = {field:newUntil}-{date:U}
40.wrap = <div class="txt2">|</div>
40.value = NEW
}
typolink.parameter.field = uid
}
}
}
结果是,新条目将获得一个额外的div-container,其中class =“txt2”。到目前为止Wokrs很好。 :-)这里生成的HTML:
<li>
<a href="link-to-my-page">
<img width="22" height="22" alt="" src="my-image.png">
<div class="txt">My-Text</div>
<div class="txt2">NEW</div>
</a>
</li>
但是现在我需要在Link上添加一个“class ='new'”或者在周围的div-container中添加一个可选的(不是我的想法,真的)。我现在试了几个小时才找到解决方案,但没有任何效果 有什么建议?
答案 0 :(得分:1)
我想ATagParams会做这个工作。使用if仅在需要时添加
tt_content.menu.20.1 >
tt_content.menu.20.1 < tt_content.menu.20.7
tt_content.menu.20.1.1.wrap = <div class="menu_list_sitemap">|</div>
tt_content.menu.20.1.1.NO {
ATagBeforeWrap = 0
doNotLinkIt = 1
stdWrap.htmlSpecialChars = 0
stdWrap.cObject = COA
stdWrap.cObject {
# Untertitel verlinken
10 = TEXT
10 {
field = subtitle
wrap = |
### snip ###
typolink.parameter.field = uid
typolink.ATagParams = class="new"
typolink.ATagParams.if.isPositive.dataWrap = {field:newUntil}-{date:U}
}
}
}