[英]TYPO3 6.2: Image-Slider with Hyperlink from Page Ressources
I did a well working Imageslider from the page ressources. 我从页面资源中做了一个很好的Imageslider。 Now I'm trying to hyperlink those Images with a Link also provided in the ressource.
现在,我正在尝试使用资源中提供的链接来超链接这些图像。 This is what I have so far:
这是我到目前为止:
TS: TS:
lib.headerimage = COA_INT
lib.headerimage {
1 = COA
1 {
stdWrap.required = 1
stdWrap.outerWrap.cObject = TEXT
stdWrap.outerWrap.cObject.value = <li><img src=" | " /></li>
2 = IMG_RESOURCE
2 {
file {
import.data = levelmedia:-1, slide
import.listNum = 0
treatIdAsReference = 1
}
}
}
2 < .1
2.2.file.import.listNum = 1
3 < .1
3.2.file.import.listNum = 2
}
Layout: 布局:
<div class="headerimage">
<ul>
<f:render section="headerimage" />
</ul>
</div>
This Results in the expected HTML Output 这导致预期的HTML输出
<ul>
<li>
<img />
</li>
</ul>
But I want the following Output 但我想要以下输出
<ul>
<li>
<a href="link_from_page_ressource">
<img />
</a>
</li>
</ul>
How do I get those Links around my Images? 如何在我的图像周围获取这些链接?
Thanks in advance 提前致谢
UPDATE UPDATE
Solution: 解:
lib.headerimage = COA
lib.headerimage {
1 = FILES
1 {
references {
data = levelmedia:-1, slide
}
renderObj = COA
renderObj {
wrap = <li>|</li>
1 = IMAGE
1 {
file.import.data = file:current:publicUrl
altText.data = file:current:title
stdWrap.typolink.parameter.data = file:current:link
}
}
}
}
You shoul use FILES
to handle this. 你应该使用
FILES
来处理这个问题。 Use something like (not tested!) 使用类似的东西(未经测试!)
lib.headerimage = COA
lib.headerimage {
wrap = <ul>|</ul>
10 = FILES
10 {
references {
data = levelmedia:-1, slide
}
renderObj = COA
renderObj {
10 = IMAGE
10 {
file.import.data = file:current:publicUrl
altText.data = file:current:title
stdWrap.typolink.parameter.data = file:current:link
wrap = <li>|</li>
}
}
}
}
Can you try this? 你能试试吗?
lib.headerimage = COA
lib.headerimage {
wrap = <ul>|</ul>
1 = IMAGE
1 {
file {
import.data = levelmedia:-1, slide
import.listNum = 0
treatIdAsReference = 1
}
stdWrap.typolink.parameter.data = file:current:link
stdWrap.outerWrap = <ul>|</ul>
}
2 < .1
2.file.import.listNum = 1
3 < .1
3.file.import.listNum = 2
}
lib.randomImage = COA_INT
lib.randomImage.10 = FILES
lib.randomImage.10.sorting = rand()
lib.randomImage.10 {
references {
table = pages
data = levelmedia:-1, slide
treatIdAsReference = 1
}
maxItems= 1
renderObj = COA
renderObj {
10 = IMAGE
10 {
file {
import {
data = file:current:publicUrl
}
}
}
}
stdWrap {
wrap = |
}
}
Reference link: http://www.t3hut.com/blog/post/news/detail/News/random-image-from-page-resources-files-in-typo3-62.html 参考链接: http : //www.t3hut.com/blog/post/news/detail/News/random-image-from-page-resources-files-in-typo3-62.html
This ts works for me ! 这个ts适合我!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.