[TYPO3] if colpos = 3

Bas van der Togt b.vandertogt at profinit.com
Tue Jun 5 22:13:07 CEST 2007


Hi Joey!

Sorry for my late reaction. The following TS is now working only for 
images in the border. But now there are no images rendered at all in the 
other columns anymore.

Best regards,
Bas

TS:
temp.imagesetup < tt_content.image
tt_content.image >
tt_content.image = CASE
tt_content.image {
   key.field = colPos
   default < temp.imagesetup
   1 < temp.imagesetup
   1.20.1.file >
   1.20.1.file {
     import.current = 1
     #crop and resize the picture
     width = 190c
     height = 80c

     m.mask = GIFBUILDER
     m.mask {

       # Here we create a dynamic mask with the exact same
       # dimensions as the actual image, but with rounded corners
       XY = [10.w],[10.h]
       format = jpg

       # Since the "XY" parameter doesn't have stdWrap, we "find"
       # the size by simply loading the original image again.
       10 = IMAGE
       10.file {
         import.current = 1
         #width.field = imagewidth
         width = 190
         height = 80
         maxW = {$styles.content.imgtext.maxW}
         maxW.override.data = register:maxImageWidth
         maxWInText = {$styles.content.imgtext.maxWInText}
         maxWInText.override.data = register:maxImageWidthInText
       }

       # Create a white box that fills the entire area
       20 = BOX
       20.dimensions = 0,0,[10.w],[10.h]
       20.color = #FFFFFF

       # Add Top-Left corner mask
       30 = IMAGE
       30.file = {$imagePath}cornermask_tl.gif
       30.align = l,t

       # Add Top-Right corner mask
       40 = IMAGE
       40.file = {$imagePath}cornermask_tr.gif
       40.align = r,t

       # Add Bottom-Left corner mask
       50 = IMAGE
       50.file = {$imagePath}cornermask_bl.gif
       50.align = l,b

       # Add Bottom-Left corner mask
       60 = IMAGE
       60.file = {$imagePath}cornermask_br.gif
       60.align = r,b

       70 = BOX
       70.dimensions = 0,50,190,15
       70.color = green
     }

     # The fastest method (recommended) is using a static image, like this:
     #m.bgImg = {$imagePath}clear.gif
     # But it can also be done dynamically, like this:
     m.bgImg = GIFBUILDER
     m.bgImg {

       # Here we create a dynamic bgMask
       # Dimensions of this image WILL BE THE SAME AS MASK'S
       XY = [5.w],[5.h]
       format = jpg

       5 < tt_content.image.20.1.file.m.mask.10

       10 = BOX
       10.dimensions = 0,0,[5.w],[5.h]
       10.color = {$bgColor}

       20 = TEXT
       20 {
         text.cObject < tt_content.image.20.1.altText
         offset = 15,62
         niceText = 1
         fontSize= 10
         text.case = lower
         fontFile = t3lib/fonts/verdana.ttf
         fontColor = #000000
         #shadow.blur = 60
         shadow.opacity = 40
       }
     }
   }
}

JoH asenau schreef:
>>>> I found the following TS and changed it to my own.
>>>> Now i want to activate this script only in the left column.
>>>> Can somebody help me?
>>>>
>>>> TS:
>>>> tt_content.image.20.1.file >
>>>> tt_content.image.20.1.file {
>>>>    import.current = 1
>>>>    #cropt and resized the picture
>>>>    width = 190c
>>>>    height = 80c
>>> [snip]
>>>> }
>>> Seems to be a job for CASE.
>>>
>>> temp.imagesetup < tt_content.image
>>> tt_content.image >
>>> tt_content.image = CASE
>>> tt_content.image {
>>>     key.field = colPos
>>>     default < temp.imagesetup
>>>     3 < temp.imagesetup
>>>     3.1.file >
>>>     3.1.file {
>>>         blah
>>>     }
>>> }
>>>
>>> something like this should do ...
>> Thanks for your answer Joey!
>> This is not where i'm looking for.
>> I want to activate this TS for the whole left column.
>> Pictures are added from the backend, and not trough TS.
> 
> And what do you think the code I posted does?
> It modifies the tt_content rendering behaviour.
> So when you are using styles.content.getBorder it will use another image
> setup than for the rest of the columns.
> 
> HTH
> 
> Joey
> 


More information about the TYPO3-english mailing list