Mohamed Masmoudi
Mohamed Masmoudi

Reputation: 593

Add a link wrapping an TYPO3 fluid image

I have an fluid code for mask extension:

<f:image image="{file}" alt="{file.alternative}" title="{file.title}"  class="img-fullwidth" />

I want to wrap that code with a tag with href to the same image file, so finally I will have <a href="image-file-source"><img src="image-file-source" /></a>"

Is that even possible with fluid ?

Thanks in advance for any help

Upvotes: 2

Views: 3081

Answers (3)

Lina
Lina

Reputation: 1

Use the link.typolink viewhelper like this:

<f:for each="{data.image}" as="file">
    <f:link.typolink parameter="{file.link}">
        <f:image image="{file}" />
    </f:link.typolink>
</f:for>

Upvotes: 0

Pravin Vavadiya
Pravin Vavadiya

Reputation: 3207

Try to something like this

 <f:link.typolink parameter="{file.originalResource.publicUrl}">
      <f:image image="{file}" alt="{file.alternative}" title="{file.title}" class="img-fullwidth" />
</f:link.typolink>

Upvotes: 3

Heinz Schilling
Heinz Schilling

Reputation: 2252

This working for me

<a href="{file.originalResource.publicUrl}">
    {file.originalResource.title}
</a>

In your example

<a href="{file.originalResource.publicUrl}">
    <f:image image="{file}" alt="{file.alternative}" title="{file.title}" class="img-fullwidth" />
</a>"

Upvotes: 1

Related Questions