[TYPO3] Re: [Typo3] Getting name of the imported file in the IMAGE object

Dmitry Dulepov typo3 at fm-world.ru
Wed Jan 4 09:37:44 CET 2006


Hi!

Dmitry Dulepov wrote:
> Hi!
> 
> Christopher wrote:
> 
>>So you need the processed image name and the unprocessed name too?
>>Change your TS above to this, and see if it works for you:
>>
>>         10 = IMG_RESOURCE
>>         10.file.import = uploads/tx_templavoila/
>>         10.file.import.current = 1
>>         10.file.import.listNum = 0
>>
>>...since you're not doing any work on the image, you should just get
>>the path to the original I think (or at least the path to the
>>un-altered copy that T3 may make which should be good enough..?)
> 
> I have "maxW" there, so typo3 resize image all the time... I ended up
> with the following Templavoila-specific and not very elegant solution:
> ================================
> 	5 = TEXT
> 	5.field = field_spare_image
> 	5.wrap = <a href="javascript:setImage('product-full-image-main',
> 'uploads/tx_templavoila/|')">
> 
> 	10 < temp.image
> 	10 = IMAGE
> 	10 {
> 		file {
> 			import = uploads/tx_templavoila/
> 			import {
> 				current = 1
> 				listNum = 0
> 			}
> 			maxW = 66
> 		}
> 	}
> 	15 = TEXT
> 	15.value = </a>
> ==================
> 
> The key was the second line of this TS with the name of flexform field.
> 
> I say it is not elegant because I wanted to have only "10" in it with
> various (std)wraps but could not manage to fit everything in "10" :(
> 
> Took me the whole day to find such a simple thing. Sometimes I feel like
> a beginner in typo3 even though I am actively developing with it more
> than a year :) Such an interesting life! :)

I found better solution:

	10 = IMAGE
	10 {
		file {
			import = uploads/tx_templavoila/
			import {
				current = 1
				listNum = 0
			}
			maxW = 66
		}
	}
	10.stdWrap.innerWrap.field = field_spare_image
	10.stdWrap.innerWrap.wrap = <a class="product-spare-image"
href="javascript:setImage('product-full-image-main',
'uploads/tx_templavoila/|')">
	10.stdWrap.innerWrap2 = |</a>

Fortunately, there are many wraps in typo3 :)

Dmitry.



More information about the TYPO3-english mailing list