首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从当前镜像中获取文件名

从当前镜像中获取文件名
EN

Stack Overflow用户
提问于 2012-12-03 17:52:32
回答 2查看 1.4K关注 0票数 1

谁能告诉我怎样才能得到当前的图像文件名。我必须链接当前图像才能在lightbox中打开它。

我的代码:

代码语言:javascript
复制
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/|
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-12-03 18:23:17

在img维护过程中,您应该设置一些特殊的变量。来自TYPO3维基

IMG_RESOURCE:在呈现img_resource时,TYPO3设置TSFE:lastImgResourceInfo,这是一个图像信息的数字数组

代码语言:javascript
复制
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

因此您可以使用它们,例如处理数据

代码语言:javascript
复制
10 = TEXT
10.data = TSFE:lastImgResourceInfo|3
票数 3
EN

Stack Overflow用户

发布于 2012-12-03 22:02:32

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

字段"image“

代码语言:javascript
复制
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
}
} 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13680742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档