[TYPO3-german] typoscript: maxW für bestimmte Bilder

Ulrich Fischer ulrich-fischer at gmx.net
Thu Nov 15 16:15:26 CET 2007


Hallo,

Ulrich Fischer schrieb am 15.11.2007 14:13:
> Ich vermute das geht nur
> in der Klasse selbst: class.tx_rggooglemap_pi1.php

Ja, dort geht es (quick and dirty einfach in die Klasse).

Man kann ins Setup drei zusätzliche Parameter
schreiben, die bei einer Bildhöhe von kleiner
50 Pixel (MinH) greifen sollen:
file1.minH, file1.maxW, wrap1

   image = IMAGE
   image {

     file.maxH = 200
     file.maxW = 80
     wrap  = <p class="left"> | </p>

     # if image height > 50, let the image float
     # special parameters for class.tx_rggooglemap_pi1.php
     file1.minH = 50
     file1.maxW = 300
     wrap1 = <p> | </p>
   }


In class.tx_rggooglemap_pi1.php wird nachgesehen,
ob eine Mindesthöhe definiert ist. Ist dies der Fall
und wird sie unterschritten, werden die Parameter
wrap und maxW im array $imgTSConfig überschrieben.


$imgTSConfig = $conf['image.'];
$imgArr = explode(',', $row['image']);
foreach ($imgArr as $k=>$v) {

# iserted by sunfish - restore original wrap
$imgTSConfig['wrap'] = $conf['image.']['wrap'];
# end of insert

$imgTSConfig['file'] = 'uploads/pics/'.$v;		
$imgTSConfig['file.']['maxW'] = $conf['image.']['file.']['maxW'];

# inserted by sunfish  - get the height of the image
if(isset($conf['image.']['file1.']['minH'])) {
   $imgsize = getimagesize ($imgTSConfig['file']);
   if($imgsize[1] < $conf['image.']['file1.']['minH']){
	 $imgTSConfig['file.']['maxW'] = $conf['image.']['file1.']['maxW'];	
	 if(isset ($conf['image.']['wrap1'])){
		$imgTSConfig['wrap'] = $conf['image.']['wrap1'];
	 }	
   }
  }
# end of insert

$markerArray['###IMAGE###'] .=  $this->cObj->IMAGE($imgTSConfig); 	
}


Schöne Grüße

Ulrich

-- 
http://www.sunfish.de


More information about the TYPO3-german mailing list