[TYPO3] Math in TypoScript

JoH asenau info at cybercraft.de
Thu Feb 22 23:41:01 CET 2007


> I have a header image that is different for each page, and the image
> itself is horizontally cut into two parts, to allow nice curved border
> in a table-based layout.
> So I set the upper part of the image like this:
> 1.file.param = -resize 100x50 -crop 40x30+0+0
>
>
> The lower part's crop should move according to the upper part's crop,
> like this:
>
> 2.file.param = -resize 100x50 -crop 37x20+43+30
>
> Sometimes I want to change the crop offset parameter, to get an other
> part of the image, so the upper and the lower parts should move
> together.
>
> So I want like this:
>
> 1.file.param = -resize 100x50 -crop 40x30+{$xoffset}+{$yoffset}
>
> 2.file.param = -resize 100x50 -crop 37x20+{$xoffset + 43} + {$yoffset
> + 30}
>
> I hope you can understand me.

Not really, since I don't understand why you want to do any math here.
If the crop is different on a per page base, you can simply change the
parameters using an extension template (+ext) for the pages.

The rest of the template will stay as is while only one different line of TS
will change the behaviour of the image for each page.

Calculating the crop parameters would only make sense if you need to do it
based on dynamic values (i.e. GET parameters or other stuff that could
influence the crop) - but in this case there seems to be nothing like that,
so no math necessary.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list