0

目前,我正在使用如下代码为横幅滑块制作图像列表:

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 时获得了 0 的乐趣,主要是因为我收到的文档和/或“帮助”对我来说几乎完全没用。我只提到这一点,也许有人会为我分解这个,就像我为其他人分解 jquery/php/.net 问题一样。有礼貌并显示一个小块“逐步”说明并没有什么坏处!

4

1 回答 1

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
      }
    }
  }
}
于 2013-07-26T06:49:46.180 回答