我的自制旋转木马滑块有问题。不幸的是,订单是随机的!
滑块元素的pid在TS常量中定义:
slider_site_ids = 1359,1348,1076,1067,1078,1117,1346,1349,1376
但是这个顺序不是页面上显示的顺序。
滑块本身的构建方式如下:
lib.contentSlider = COA
lib.contentSlider {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 1
select.languageField = sys_language_uid
select.orderBy = sorting
select.pidInList = {$slider_site_ids}
}
10.wrap = <div class="slider-img-cnt">|</div>
20 = CONTENT
20 {
table = tt_content
select.where = colPos = 10
select.languageField = sys_language_uid
select.pidInList = {$slider_site_ids}
}
20.wrap = <div class="content-left fl-left">|</div>
30 = CONTENT
30 {
table = tt_content
select.where = colPos = 20
select.languageField = sys_language_uid
select.pidInList = {$slider_site_ids}
}
30.wrap = <div class="content-right fl-right">|</div>
40 = CONTENT
40 {
table = tt_content
select.where = colPos = 30
select.languageField = sys_language_uid
select.pidInList = {$slider_site_ids}
}
40.wrap = <div class="slogan-box"><div class="first-line">|</div>
50 = CONTENT
50 {
table = tt_content
select.where = colPos = 40
select.languageField = sys_language_uid
select.pidInList = {$slider_site_ids}
}
50.wrap = <div class="second-line">|</div>
60 = CONTENT
60 {
table = tt_content
select.where = colPos = 50
select.languageField = sys_language_uid
select.pidInList = {$slider_site_ids}
}
60.wrap = <div class="third-line">|</div></div>
}
lib.contentSlider.wrap = <article>|</article>
有没有办法定义排序顺序?也许每个循环都可以做到这一点?有什么想法吗?
答案 0 :(得分:-1)
您可以尝试使用split function的typoscript。
编辑:示例
20 = TEXT
20 {
value = {$slider_site_ids}
split {
token = ,
cObjNum = 1
1.10 = CONTENT
1.10 {
table = tt_content
select.where = colPos = 10
select.languageField = sys_language_uid
select.pidInList.current = 1
}
}
}