[TYPO3] Image zoom only if width > X
JoH
info at cybercraft.de
Wed Aug 9 11:59:43 CEST 2006
>>> To have image zoom for all pictures, this is the code:
>>>
>>> tt_content.image.20.1.imageLinkWrap.enable.field >
>>> tt_content.image.20.1.imageLinkWrap.enable = 1
>>>
>>> But how to enable image zoom if picture is wider than X pixels only?
>>
>> There was a constant somewhere in the constant editor for this. I do
>> not remember its name however. There were two of them actually: one
>> for maximum width of preview image, another for maximum width of the
>> complete image. I usually said first to 450 and second to 2000 (to
>> prevent resizing of complete image).
>>
> styles.content.imgtext.maxW and styles.content.imgtext.maxWInText
> doesn't do the work.
>
> The idea is something like this:
>
>
> tt_content.image.20.1.imageLinkWrap.enable.field >
> tt_content.image.20.1.imageLinkWrap.enable = 1
> tt_content.image.20.1.imageLinkWrap.enable.value =
> {$styles.content.imgtext.maxWInText}
> tt_content.image.20.1.imageLinkWrap.enable.isGreaterThan = WIDTH OF
> CURRENT IMAGE
>
>
> It should provide link for zoom if current image is wider than
> {$styles.content.imgtext.maxWInText} only.
Since "enable" offers stdWrap you could do this:
tt_content.image.20.1.imageLinkWrap {
enable.data = register:IMAGE_NUM
enable.postUserFunc = yourWidthCheckingFunction
}
You need the register to get the position of the image in the CSV list of
files.
Not tested though
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
More information about the TYPO3-english
mailing list