[TYPO3-english] f:image f:uri.image giving different URLs

Helmut Hummel helmut.hummel at typo3.org
Fri Jun 12 16:42:20 CEST 2015


Jan Bednarik wrote:

> I have a fluidcontent with FAL:
>
> <flux:field.inline.fal name="images" label="Obrázky"
> enabledControls="{dragdrop:true}" collapseAll="true" maxItems="9999"/>
>
> And then I'm displaying them in for-each as:
>
> <a href="{f:uri.image(src:image.uid,treatIdAsReference:true)}"
> class="lightbox" rel="lightbox">
>                               <f:image src="{image.uid}"
> treatIdAsReference="true" width="100"/>

...

> Any idea what I'm doing wrong?

I prefer to use "1" and "0" instead of "true" for boolean values.
Fluid treats all strings as bool TRUE if the string is not "flase"

However in your case, the real reason is, that in the shorthand sytax
"treatIdAsReference:true" means the key "treatIdAsReference" will 
contain the value of the *variable* with the name "true". This is of 
course not what you mean. Instead you should write the following:

{f:uri.image(src:image.uid,treatIdAsReference:'true')}

Or even *MUCH* better: Don't use "src" and "treatIdAsReference" *at all*

<a href="{f:uri.image(image:image)}"
    class="lightbox"
    rel="lightbox">
<f:image image="{image}"
          width="100" />
</a>

Much shorter, less error prone!

Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list