[TYPO3-german] image file skalieren in eigener extension
Patrick Riekert
priekert at fconnection.com
Fri Jun 25 09:41:01 CEST 2010
Hallo Domi
Ich würde mir mittels Typoscript ein Image-Objekt erstellen und dies dann jeweils in der Extension anpassen.
TS
plugin.tx_meineExtension_pi1 {
imageConf = IMAGE
imageConf {
file =
file {
#Standardbreite
width = 150
# Standardhöhe
height = 168
}
}
}
In der Extension dann in der gewünschten Methode einfach
$lconf = $this->conf['imageConf.'];
$lconf['file'] = 'fileadmin/img/list/'.$row['picture'];
// Datei erzeugen
$this->cObj->IMG_RESOURCE($lconf)
Und dem Marker zuweisen
$markerArray['###PICTURE###'] = '<img width="150" border="0" title="" alt="" src="'.$this->cObj->IMG_RESOURCE($lconf).'" />'
Gruss Patrick
-----Ursprüngliche Nachricht-----
Von: typo3-german-bounces at lists.typo3.org [mailto:typo3-german-bounces at lists.typo3.org] Im Auftrag von Domi Garms
Gesendet: Freitag, 25. Juni 2010 08:50
An: German TYPO3 Userlist
Betreff: [TYPO3-german] image file skalieren in eigener extension
Hallo Liste
ich habe eine eigene Extension programmiert, welche Eine Liste eines Katalogs darstellen soll. Zu jedem Listeneintrag wird auch ein Bild hochgeladen und dargestellt, jedoch scheiter ich gerade an den Eigenschaften des Bildes. Und zwar soll das Bild verlinkt werden und maximal 150px breit sein, jedoch bekomme ich das Wrappen und das Skalieren nicht hin. Alle Bilder werde immer in Originalgröße dargestellt. Besser wäre vielleicht, beim Upload der Bilder zu skalieren, jedoch hab ich dafür noch keinen Ansatz.
Auszug aus der tx_test_pi1.php
while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$markerArray['###LINK###']=$this->pi_linkToPage($row['name'],$row['link']);
$markerArray['###NAME###']=$row['name'];
$markerArray['###DESCRIPTION###']=$row['description'];
$markerArray['###PICTURE###']=$this->cObj->IMAGE(array(
'file' => 'fileadmin/img/list/'.$row['picture'],
'altText' => $row['name'],
'titleText' => $row['name'],
'maxW' => 140
));
$liste .=
$this->cObj->substituteMarkerArrayCached($singlerow,$markerArray);
}
Grüße
Domi
_______________________________________________
TYPO3-german mailing list
TYPO3-german at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
More information about the TYPO3-german
mailing list