typo3fluidtypo3-7.6.xviewhelper

TYPO3 <f:image /> nest viewhelper or use the processed image somehow for lazyload


I'm trying to imply lazyload with a specific slider, it requests the src of the image to be entered twice, once as src and second as data-lazy like this:

<img src="domain.com/image.png" data-lazy="domain.com/image.png">

with <f:image /> I can use data="{lazy: 'domain.com/image.png'}" and should repeat the src of the image created with the viewhelper ... (typo3 documentation and the inline use of f:uri.image)

i have actually two questions:

the solution should work for TYPO3 v7 and v8


Solution

  • Try this

    <img src="{f:uri.image(src : image.uid)}" data-lazy="{f:uri.image(src : image.uid)}" />
    

    You don't have to use the <f:image ..> tag for creating the <f:uri.image ..> returns the same processed resource.