[TYPO3-templavoila] FCE - Image with checkbox to select if 'click enlarge in lightbox' or not

Ian Solo ian at webian.it
Thu Aug 30 16:39:38 CEST 2007


Hi Dmitry!
Thank you for the lesson... I really need to better understand Typoscript! 
:)

I changed the typoscript of the field_image as:
--------------------------------
<![CDATA[
 10 = IMAGE
 10.file.import = uploads/tx_templavoila/
 10.file.import.current = 1
 10.file.import.listNum = 0
 10.imageLightbox2 = 1
 10.if.value.field = field_enlarge
 10.if.equals = 1

 20 = IMAGE
 20.file.import = uploads/tx_templavoila/
 20.file.import.current = 1
 20.file.import.listNum = 0
 20.imageLightbox2 = 0
 20.if.value.field = field_enlarge
 20.if.equals = 0
]]>
--------------------------------

and it works! =D
But maybe there's a more elegant way to do it.
Btw, thank you for your help!ian

"Dmitry Dulepov [typo3]" <dmitry at typo3.org> ha scritto nel messaggio 
news:mailman.1.1188470866.3057.typo3-project-templavoila at lists.netfielders.de...
> Hi!
>
> Problem is more related to understanding how TypoScript works.
>
> Ian Solo wrote:
>> Now there's the problem. I tryed many ways to pass the value of the 
>> checkbox to the typoscript of the field_image at this point:
>> --------------------------------
>> 10.imageLightbox2 = <value of the checkbox>
>> --------------------------------
>
> For that imageLightbox2 must be of type stdWrap. But extension manual says 
> that it is simple boolean 
> (http://typo3.org/documentation/document-library/extension-manuals/kj_imagelightbox2/1.4.2/view/1/2/)
>
>> but i can't find the way to pass it.
>>
>> I tryed:
>> --------------------------------
>> 10.imageLightbox2 = field_enlarge
>
> This makes 10.imageLightbox2 equal to string "field_enlarge"
>
>> --------------------------------
>> 10.imageLightbox2.field = field_enlarge
>
> This makes 10.imageLightbox2 an array with a member named "field", which 
> is equal to string "field_enlarge"
>
>> --------------------------------
>> 10.imageLightbox2.data = field:field_enlarge
>> --------------------------------
>
> Almost same as above
>
>> 10.imageLightbox2 < field_enlarge
>
> This makes 10.imageLightbox2 empty string because there is not TS object 
> named "field_enlarge"
>
>> --------------------------------
>> temp.enlarge = TEXT
>> temp.enlarge.field = field_enlarge
>> 10.imageLightbox2 < temp.enlarge
>> --------------------------------
>
> This creates the following:
>
> 10.imageLightbox2 = TEXT
> 10.imageLightbox2.field = field_enlarge
>
> Remember, you do not copy ~result~ of TEXT object execution, you copy the 
> object itself!
>
>> But none worked for me.
>>
>> Any tips please?
>
> There are two ways:
> - ask extension author to make this field "stdWrap". This is simple: just 
> one call to one function ($this->cObj->stdWrap) from extension. Than you 
> can use "data" or "field" as you tried above
> - write more complex TS with "if"s that check value of the field and 
> output image correspondingly
>
> -- 
> Dmitry Dulepov
> TYPO3 freelancer / TYPO3 core team member
> Web: http://typo3bloke.net/
> Skype: callto:liels_bugs 




More information about the TYPO3-project-templavoila mailing list