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

Ian Solo ian at webian.it
Sun Sep 2 12:52:02 CEST 2007


This is a more elegant way to write the Typoscript:
---------------------------------
<![CDATA[
	10 = IMAGE
	10.file.import = uploads/tx_templavoila/
	10.file.import.current = 1
	10.file.import.listNum = 0
	10.file.maxW = 100
	10.imageLightbox2 = 1
	10.if.value.field = field_enlarge
	10.if.equals = 1
	
	20 < 10
	20.imageLightbox2 = 0
	20.if.equals = 0
]]>
---------------------------------
Now there's not replication of data between objects 10 and 20.

I attach the complete DS for who need a FCE with an image field and a 
checkbox to select if the image will be enlarged or not with Lightbox.

This can be added to your existing DS structure.

Bye!ian

Ian Solo wrote:
> 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