[Typo3-dev] Setting a value for a condition via TS

Peter Russ peter.russ at 4dfx.de
Fri Feb 25 18:11:11 CET 2005


JoH schrieb:

>>>But how do I use this value in a condition?
>>>The problem is, that I have to set a value for a property that
>>>hasn't got stdWrap properties depending on a value taken from a
>>>field.
>>>
>>
>>Check for "if" TS-Ref. p.31.
>>Should make what you want.
> 
> 
> Nope - "if" can only be used in two cases:
> 1. The property or object has "if" as a property
> 2. The property or object has "stdWrap" properties
> 
This was not clear as you asked.

> In my case it's the "params" property of IMAGE that I need to be filled with
> different parameters based on two fields: image_effects and
> image_compression.
> Since "params" can only be filled with simple text with no cObject or
> stdWrap available I have to do it in another way.
> 
> temp.whatever = -rotate 90
> 
> 10 = IMAGE
> 10.params < temp.whatever
> 
> works, but I am not able to fill temp.whatever based on a field value since
> 
> temp.whatever = CASE
> temp.whatever {
> key.field = image_effects
> 1 = -rotate 90
> 2 = -rotate -90
> ...
> and so on
> ...
> }
> 
> 10 = IMAGE
> 10.params < temp.whatever
> 
> doesn't work.
> 
> I can't use IMGTEXT since it's exactly the object IMGTEXT I am going to
> replace by my own TS-setup to get fully valid XHTML with Bobby AAA approval.
> Works perfectly fine with all features except those two fields.
> I personally never used them, but since it should be a solution for possible
> clients, I need those params.
> 
> Joey
> 
> 
	/**
	 * ImageMagick parameters for image effects
	 *
	 * @see IMGTEXT()
	 */
	var $image_effects = Array(
		1 => '-rotate 90',
		2 => '-rotate 270',
		3 => '-rotate 180',
		10 => '-colorspace GRAY',
		11 => '-sharpen 70',
		20 => '-normalize',
		23 => '-contrast',
		25 => '-gamma 1.3',
		26 => '-gamma 0.8'
	);

as both are properties of IMAGE it's not clear to me why you can't do it 
similar

10=IMAGE
10{
	image_compresssion.field=which.field.you.whish
}

Regs. Peter.




More information about the TYPO3-dev mailing list