2012-12-03 162 views
1

任何人都可以告訴我如何獲取當前圖像的文件名。我必須鏈接當前圖像才能在Lightbox中打開它。從當前圖像獲取文件名

我的代碼:

15 = TEXT 
    15 { 
     field = image 
     split { 


     token = , 
     cObjNum = 1 || 3 || 3 


     //ignore 
     1.... 


     3 { 
      10 = IMAGE 
      10.file.import.current = 1 
      10.file.import = uploads/pics/ 
      10.file.maxW = 270 
      10.params = class="hidden" 

      10.imageLinkWrap = 1 
      10.imageLinkWrap { 
      enable = 1 
      typolink.parameter = TEXT 
      typolink.parameter.field = image 
      typolink.parameter.listNum.splitChar = , 

      typolink.parameter.listNum = // <- Need current image number 
      typolink.parameter.wrap = /uploads/pics/| 

回答

3

你應該有一些特殊的增值經銷商的img mainpulation期間設置。從TYPO3維基

IMG_RESOURCE: 儘管渲染img_resource TYPO3設置TSFE:lastImgResourceInfo其是圖像信息的數值陣列

TSFE:lastImgResourceInfo|0 contains the width (after scaling) of the image 
TSFE:lastImgResourceInfo|1 contains the height (after scaling) of the image 
TSFE:lastImgResourceInfo|2 contains the image file extension 
TSFE:lastImgResourceInfo|3 contains the path to the (scaled) image file 
TSFE:lastImgResourceInfo|origFile contains the name (path?) of the original file 
TSFE:lastImgResourceInfo|origFile_mtime contains the the last modification time of the original file 

所以可以使用它們例如用數據

10 = TEXT 
10.data = TSFE:lastImgResourceInfo|3 
+0

謝謝,但我自己找到了另一個解決方案(+廚師)。這裏是我的解決方案: typolink.parameter.stdWrap.data = register:SPLIT_COUNT – anguish

+0

其實我的答案是錯誤的。我太快讀了你的問題。我雖然你需要重新命名的圖像名稱。最好的辦法是你爲你提出一個單獨的答案,然後我的答案將被刪除。 – Krystian

0

http://wiki.typo3.org/TSref/stdWrap#current http://www.typo3wizard.com/de/snippets/general-config/bild-aus-media-feld.html

字段「圖片」

lib.images=TEXT 
lib.images.data= levelmedia: 2,slide 
lib.images.wrap=<div id="bilder">|</div> 
lib.images.split{ 
token=, 
cObjNum=1 
1.10=IMAGE 
1.10.file{ 
import.current=1 
import=uploads/media/ 
width = 270 
height= 300 
} 
}