[TYPO3-ttnews] Problem with generating images to new marker "preview_image" using itemMarkerArrayFunc
Frank Mey - NEW.EGO
mey_mailings at newego.de
Mon May 23 13:06:59 CEST 2011
Hi list,
I am using the itemMarkerArrayFunc hook in tt_news 3.x to get pictures
from a custom added DB field into the list-view oft t_news.
My userFunc looks like this:
function user_displayPreviewImage( $markerArray, $conf ) {
$row = $conf ['parentObj']->local_cObj->data; // get the data array of
the current news record
if ($conf ['parentObj']->config['code'] == 'LIST') {
if ($row ['tx_nettnewsext_previewimage'] != '') {
$img = array ();
$img ['file'] = 'uploads/tx_ttnews/' . $row
['tx_nettnewsext_previewimage'];
$img ['file.']['format'] = 'jpg';
$img ['file.']['quality'] = '75';
if (($conf ['code'] = 'LIST3') || ($conf ['code'] =
'LIST2')) {
$img ['file.'] ['width'] = '291c';
$img ['file.'] ['height'] = '144c';
} else { // Bildausschnitt für C-Teaser
$img ['file.'] ['width'] = '186c';
$img ['file.'] ['height'] = '106c';
}
$markerArray ['###PREVIEW_IMAGE###'] = $conf
['parentObj']->local_cObj->IMAGE ( $img );
} else {
$markerArray ['###PREVIEW_IMAGE###'] = '';
}
}
return $markerArray;
}
Sadly, the returned IMG-Tag looks i.e. like this: <img src="22."
width="291" height="144" border="0" alt=""> .
It seems like the function cImage in the TYPO3 Core, which is called from
the
->cObj->IMAGE render() function gets the
Right conf[file] data but seems to loose the filename and filepath
somehow.
How can this path issue be solved ? The DB field only holds the file name
and is correctly configured via the TCA.
Can I pass a output path to the cImage function directly ?
Thx for info and help J
Frank Mey
More information about the TYPO3-project-tt-news
mailing list