目前我正在使用以下代码制作横幅滑块的图像列表:
page.10.marks.topimage = IMAGE
page.10.marks.topimage {
file.import.data = levelmedia: -1, "slide"
file.import = fileadmin/user_upload/
file.import.override.field = media
file.import.current = 1
file.import.listNum = 0
border = 0
file.height = 670
file.width = 1800
altText = Banner
titleText = Banner
wrap = <div id="slides">|
}
page.10.marks.topimage1 = IMAGE
page.10.marks.topimage1 {
file.import.data = levelmedia: -1, "slide"
file.import = fileadmin/user_upload/
file.import.override.field = media
file.import.current = 1
file.import.listNum = 1
border = 0
file.height = 670
file.width = 1800
altText = Banner
titleText = Banner
}
etc...
但是,这意味着,每当其他管理员想要添加新幻灯片或从总计数中删除一张幻灯片时,我就必须更改此代码。添加幻灯片的内容不是问题,他们只需上传到user_upload,并在当前拉0到3。但是,他们希望能够上传5张图片并将其显示为5或只显示3并让它显示3并且我需要更多dynamic
方式来实现此功能。我还是Typo3的新手(我真的不明白它,PHP更容易10,000倍!),所以如果有人可以,请向我解释比文档更好,子部分如何工作或我的解决方案可能是什么。
不,我不能只写一个extension
去做。去过那里并尝试过,但仍然无法弄清楚如何在不破坏扩展的情况下进行扩展。
仅供参考,如果你可以分解并帮助我“喜欢”它,这将是伟大的,因为在目前,我宁愿他们使用wordpress或joomla或任何东西,但这。如果你已经看到了我的其他问题,那么你会意识到,我在使用这个cms时有很多乐趣,主要是因为我收到的文档和/或“帮助”对我来说几乎完全没用。我只提这个,所以也许有人会为我打破这个,就像我为别人打破jquery / php / .net问题。礼貌并显示一个“逐步”的指示并不会有害!
答案 0 :(得分:2)
page.10.marks.topimage = TEXT
page.10.marks.topimage {
# retrieve data
data = levelmedia: -1, "slide"
override.field = media
# we have some filenames in a list, let us split the list
# and create images one by one
# if there are five images selected, the CARRAY "1" will be executed
# five times where current is loaded with only one filename
split {
# the images are separated via ","
token = ,
# you can do funny stuff with options split, f.e. if you want to give first
# and last image a different class... but thats another topic;)
# we just say, render every splitted object via CARRAY "1"
cObjNum = 1
1 {
# just render the single image,
# now there should be one filename in current only
10 = IMAGE
10 {
file.import.wrap = fileadmin/user_upload/|
file.import.current = 1
border = 0
file.height = 670
file.width = 1800
altText = Banner
titleText = Banner
}
}
}
}