我有一个联系人弹出窗口,当用户点击侧面按钮时会显示该弹出窗口。 该图层应该在右下角有一个链接,为此,我想使用tt_content中的header_link字段。但我也不想将标题链接起来。
那么,如何在没有标题的情况下获取内容?
lib.contactLayer = COA
lib.contactLayer {
10 = TEXT
10.value = <a id="contactHandle" href="#"></a>
20 = COA
20 {
10 = CONTENT
10 {
table = tt_content
select {
pidInList = {$storageFolder.records}
uidInList = {$record.contactLayer}
orderBy = sorting
}
}
20 = TEXT
20.value = <a href="#" id="contactLayerClose"></a>
30 = CONTENT
30 {
table = tt_content
select {
pidInList = {$storageFolder.records}
uidInList = {$record.contactLayer}
orderBy = sorting
}
renderObj = COA
renderObj {
10 = TEXT
10 {
value = Kontakt aufnehmen
stdWrap.typolink {
parameter.field = header_link
wrap (
<span id="contactLayerLinkText">|</span>
<span class="icon"></span>
)
ATagBeforeWrap = 1
ATagParams = id="contactLayerLink" class="clearfix"
}
}
}
}
wrap = <section id="contactLayer">|</section>
}
}
编辑:我的方法从一开始就错了,因为我正在进行2次SQL查询。这是我最终得到的,使用一个CONTENT和renderObj:
lib.contactLayer = COA
lib.contactLayer {
10 = TEXT
10.value = <a id="contactHandle" href="#"></a>
20 = COA
20 {
10 = CONTENT
10 {
table = tt_content
select {
pidInList = {$storageFolder.records}
uidInList = {$record.contactLayer}
orderBy = sorting
}
renderObj = COA
renderObj {
10 = TEXT
10.value = <a href="#" id="contactLayerClose"></a>
20 = FILES
20 {
references {
table = tt_content
uid.field = uid
fieldName = image
}
renderObj = IMAGE
renderObj {
file.import.data = file:current:publicUrl
}
}
30 = COA
30 {
10 = TEXT
10.field = header
10.wrap = <h1>|</h1>
20 = TEXT
20.field = subheader
20.wrap = <h2>|</h2>
30 = TEXT
30.field = bodytext
wrap = <div class="text">|</div>
}
40 = TEXT
40 {
value = Kontakt aufnehmen
stdWrap.typolink {
parameter.field = header_link
wrap (
<span id="contactLayerLinkText">|</span>
<span class="icon"></span>
)
ATagBeforeWrap = 1
ATagParams = id="contactLayerLink" class="clearfix"
}
}
}
}
wrap = <section id="contactLayer">|</section>
}
}
答案 0 :(得分:0)
我的方法从一开始就是错误的,因为我正在进行2次SQL查询。这是我最终得到的,使用一个CONTENT和renderObj:
lib.contactLayer = COA
lib.contactLayer {
10 = TEXT
10.value = <a id="contactHandle" href="#"></a>
20 = COA
20 {
10 = CONTENT
10 {
table = tt_content
select {
pidInList = {$storageFolder.records}
uidInList = {$record.contactLayer}
orderBy = sorting
}
renderObj = COA
renderObj {
10 = TEXT
10.value = <a href="#" id="contactLayerClose"></a>
20 = FILES
20 {
references {
table = tt_content
uid.field = uid
fieldName = image
}
renderObj = IMAGE
renderObj {
file.import.data = file:current:publicUrl
}
}
30 = COA
30 {
10 = TEXT
10.field = header
10.wrap = <h1>|</h1>
20 = TEXT
20.field = subheader
20.wrap = <h2>|</h2>
30 = TEXT
30.field = bodytext
wrap = <div class="text">|</div>
}
40 = TEXT
40 {
value = Kontakt aufnehmen
stdWrap.typolink {
parameter.field = header_link
wrap (
<span id="contactLayerLinkText">|</span>
<span class="icon"></span>
)
ATagBeforeWrap = 1
ATagParams = id="contactLayerLink" class="clearfix"
}
}
}
}
wrap = <section id="contactLayer">|</section>
}
}