链接到typoscript中的imagefile

时间:2014-03-13 07:09:17

标签: hyperlink typo3 typoscript photoswipe

我想在typo3 Vers中使用photoswipe。 6.1,所以我需要得到像这样的html:

<ul id="Gallery" class="gallery">
<li><a href="fileadmin/images/mobile/Verschiedenes/full/DSC_0110.JPG" rel="external"><img src="fileadmin/images/mobile/Verschiedenes/thumbs/DSC_0110.JPG" alt="Image 01" /></a></li>
<li><a href="fileadmin/images/mobile/Verschiedenes/full/DSC_0111.JPG" rel="external"><img src="fileadmin/images/mobile/Verschiedenes/thumbs/DSC_0111.JPG" alt="Image 02" /></a></li>
</ul>

为了得到这个,我在页面上使用“Recources”推出了图片,并添加了以下的typoscript-code:

temp.pics = FILES
temp.pics {
     #folders = 1:thumbs/
       references {
            table = pages
            uid.data = tsfe:id
            fieldName = media
}
renderObj = IMAGE
renderObj {
#file.import.data = file:current:originalUrl
file.import.data = file:current:originalUid
altText.data = file:current:title
wrap = <li>|</li>
imageLinkWrap = 1
    imageLinkWrap {
      # Activate ImageLinkWrap.
      enable = 1
      typolink.parameter = fileadmin/images/mobile/Verschiedenes/full/{field:current:uid}

      }
 }
stdWrap.wrap = <ul id="Gallery" class="gallery">|</ul>
}


 page.10 {
  template.file = fileadmin/templates/mobile/main_bilder.html
  marks.BILDER < temp.pics
 }

之后我得到了几乎,我想要的,但以下的html输出不是我想要的:

 <a class="ui-link" href="fileadmin/images/mobile/Verschiedenes/full/{field:current:uid}">

因此变量{field:current:uid}不会被文件名替换。有人有想法吗?

非常感谢!

2 个答案:

答案 0 :(得分:1)

尝试

typolink.parameter.data = ...

typolink.parameter = ...
typolink.parameter.insertData = 1

答案 1 :(得分:1)

感谢您指点我正确的方向!在我的星座中,这是正确的代码:

temp.pics = FILES
temp.pics {
  references {
     table = pages
     uid.data = tsfe:id
     fieldName = media
     }
  renderObj = IMAGE
  renderObj {
    file.import.data = file:current:originalUid
    altText.data = file:current:title
    wrap = <li>|</li>
    imageLinkWrap = 1
    imageLinkWrap {
      # Activate ImageLinkWrap.
      enable = 1
      typolink.parameter = fileadmin/images/mobile/Verschiedenes/full/{file:current:name}
      typolink.parameter.insertData = 1
    }
  }
stdWrap.wrap = <ul id="Gallery" class="gallery">|</ul>
}



page.10.marks.BILDER < temp.pics