Hallo zusammen!
Ich möchte im News-Modul (tt_news) in der Listenansicht nur quadratische Fotos anzeigen -also müssen die Thumbs ev. per CSS zentriert werden.
Das habe ich mir so vorgestellt (der Eintrag im Template):
<div style="width:150px; height:150px; background-image: url(###NEWS_IMAGE###); background-position:center center;">
</div>
Das Problem dabei ist aber nun dass der Marker ###NEWS_IMAGE### das komplette IMG-Tag ausgibt und nicht nur den Dateinamen des Thumbnails.
Der betroffene PHP-Code der Extension sieht so aus:
/**
* Fills the image markers with data. if a userfunction is given in "imageMarkerFunc",
* the marker Array is processed by this function.
*
* @param array $markerArray : partly filled marker array
* @param array $row : result row for a news item
* @param array $lConf : configuration for the current templatepart
* @param string $textRenderObj : name of the template subpart
* @return array $markerArray: filled markerarray
*/
function getImageMarkers($markerArray, $row, $lConf, $textRenderObj) {
// overwrite image sizes from TS with the values from the content-element if they exist.
if ($this->config['FFimgH'] || $this->config['FFimgW']) {
$lConf['image.']['file.']['maxW'] = $this->config['FFimgW'];
$lConf['image.']['file.']['maxH'] = $this->config['FFimgH'];
}
if ($this->conf['imageMarkerFunc']) {
$markerArray = $this->userProcess('imageMarkerFunc', array($markerArray, $lConf));
} else {
$imageNum = isset($lConf['imageCount']) ? $lConf['imageCount']:1;
$imageNum = t3lib_div::intInRange($imageNum, 0, 100);
$theImgCode = '';
$imgs = t3lib_div::trimExplode(',', $row['image'], 1);
$imgsCaptions = explode(chr(10), $row['imagecaption']);
$imgsAltTexts = explode(chr(10), $row['imagealttext']);
$imgsTitleTexts = explode(chr(10), $row['imagetitletext']);
reset($imgs);
$cc = 0;
// remove first img from the image array in single view if the TSvar firstImageIsPreview is set
if (( (count($imgs) > 1 && $this->config['firstImageIsPreview'])
||
(count($imgs) >= 1 && $this->config['forceFirstImageIsPreview'])
) && $textRenderObj == 'displaySingle') {
array_shift($imgs);
array_shift($imgsCaptions);
array_shift($imgsAltTexts);
array_shift($imgsTitleTexts);
}
// get img array parts for single view pages
if ($this->piVars[$this->config['singleViewPointerName']]) {
$spage = $this->piVars[$this->config['singleViewPointerName']];
$astart = $imageNum*$spage;
$imgs = array_slice($imgs,$astart,$imageNum);
$imgsCaptions = array_slice($imgsCaptions,$astart,$imageNum);
$imgsAltTexts = array_slice($imgsAltTexts,$astart,$imageNum);
$imgsTitleTexts = array_slice($imgsTitleTexts,$astart,$imageNum);
}
while (list(, $val) = each($imgs)) {
if ($cc == $imageNum) break;
if ($val) {
$lConf['image.']['altText'] = $imgsAltTexts[$cc];
$lConf['image.']['titleText'] = $imgsTitleTexts[$cc];
$lConf['image.']['file'] = 'uploads/pics/' . $val;
}
$theImgCode .= $this->local_cObj->IMAGE($lConf['image.']) . $this->local_cObj->stdWrap($imgsCaptions[$cc], $lConf['caption_stdWrap.']);
$cc++;
}
$markerArray['###NEWS_IMAGE###'] = '';
if ($cc) {
$markerArray['###NEWS_IMAGE###'] = $this->local_cObj->wrap(trim($theImgCode), $lConf['imageWrapIfAny']);
} else {
$markerArray['###NEWS_IMAGE###'] = $this->local_cObj->stdWrap($markerArray['###NEWS_IMAGE###'],$lConf['image.']['noImage_stdWrap.']);
}
}
return $markerArray;
}
Ich blicke mich da leider überhaupt nicht durch -vielleicht hat jemand eine Ahnung?
DANKE im voraus, liebe Grüße.