[TYPO3-english] FAL, pages media, default image and override if exists

Jan Slusarczyk jan.slusarczyk at gmail.com
Sun Aug 24 16:46:47 CEST 2014


I'm doing an upgrade of typo3 from 4.7 to 6.2. I've been able to solve a 
lot of mysteries on my own, but I have a problem with FILES and using a 
default image override. My old code looks like this:

before.cObject = IMAGE
before.cObject {
	file = fileadmin/templates/v103/img/100-63.png
	file.import = uploads/media/
	file.import.override.field = media
	file.import.listNum = 0
	file.width = 100
	file.height = 63m
	altText.field = subtitle
	stdWrap.typolink.parameter.field = uid
}

I want to migrate this to use FAL using the following template:

before.cObject = FILES
before.cObject {
	references {
         	table = pages
		fieldName = media
	}
	renderObj = IMAGE
	renderObj {
		altText.field = subtitle // title
		file {
			import.data = file:current:publicUrl
			width = 100
			height = 63c
		}
	}
}

What I need to modify:
1. use a default image and override if a media reference  is found
2. use only the first image defined in media field, and not every one

I've spend past few days looking for fal examples and manual but didn't 
find anything helpful. What is the best way to do this?

Thank you all
Jan


More information about the TYPO3-english mailing list