[TYPO3-dev] how to get title and anker while ressource image integration in TypoScript

Frans Saris franssaris at gmail.com
Thu Mar 5 20:40:32 CET 2015


Hi Marton,

this is the typoscript we use for adding a slider

lib.slider = COA
lib.slider {

10 = FILES
10 {
references{
data = levelmedia:-1, slide
#data = media
treatIdAsReference = 1
}
renderObj = COA
renderObj {
10 = IMAGE
10.file.import.data = file:current:originalUid // file:current:uid
10.titleText.data = file:current:title // file:current:alternative
10.altText.data = file:current:alternative // file:current:title
10.file.width = 940
10.file.height = 325c

20 = TEXT
20.data = file:current:title
20.wrap = <strong>|</strong>

stdWrap.wrap = <div>|</div>
}
}
}

gr. Frans

2015-03-05 18:17 GMT+01:00 martol man <eigentlichimmer at abwesend.de>:

> Hi,
>
> I need to implement page ressource images by TypoScript for a frontend
> teaser image slider. I wonder how to get the title attribut information
> from ressource images.
> At the moment I am using such an implementation to create image tags with
> path in it:
>
>
> resssourceimage = COA
> resssourceimage {
>        1 = COA
>        1 {
>            stdWrap.required=1
>            stdWrap.outerWrap.cObject = TEXT
>            stdWrap.outerWrap.cObject.value = <div
> class="imageitem">|</div>
>            2 = IMAGE
>            2 {
>                file {
>                    import.data = levelmedia:-1, slide
>                    import = uploads/media/
>                    import.listNum = 0
>                    treatIdAsReference = 1
>                }
>            }
>        }
>        2 < .1
>        2.2.file.import.listNum = 1
>        3 < .1
>        3.2.file.import.listNum = 2
>        4 < .1
>        4.2.file.import.listNum = 3
>        5 < .1
>        5.2.file.import.listNum = 4
>        6 < .1
>        6.2.file.import.listNum = 5
>        7 < .1
>        7.2.file.import.listNum = 6
>        8 < .1
>        8.2.file.import.listNum = 7
>        9 < .1
>        9.2.file.import.listNum = 8
>        10 < .1
>        10.2.file.import.listNum = 9
>    }
>
>
> The result will be:
> <img src="xyz.jpg" width="200" height="100" />
>
> This is perfect but now I additionally need to have the title attribute
> and alt attribute in the img tag like this:
>
> <img src="xyz.jpg" width="200" height="100" title="image title"
> alt="alternative text" />
>
> I tried things like that
>
> resssourceimage.1.data = file:current:title or
> resssourceimage.1.2.data = file:current:title
>
> but with the first one I got the page title not the title text I saved
> especially in relation to the ressource image file.
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list