---
title: "perfectlightbox in eigener Extension"
url: "https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage"]
created: "2008-08-19"
last_reply: "2012-02-28"
replies: 6
solved: false
page: 1
pages: 1
lang: "de"
---

# perfectlightbox in eigener Extension

Extensions › Entwicklung · 6 Antworten · gestartet 2008-08-19

## Eröffnungsbeitrag

**axel___** · 2008-08-19 · [Beitrag #1](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/1)

Hallo,

ich habe eine einfache Extension erzeugt, die unter anderem Bilder anzeigt. Nun möchte ich diese gerne per Mausklick vergrößern und dazu die bereits installierte Extension Perfect Lightbox2 verwenden.
Aktuell sieht mein Code so aus:

```php
$imgTSConfig = array();
$imgTSConfig['altText'] = '';
$imgTSConfig['titleText'] = '';
$imgTSConfig['file.']['maxW'] = 120;
$imgTSConfig['file.']['maxH'] = 120;
$imgTSConfig['file'] = 'uploads/pics/test.jpg';
return $this->cObj->IMAGE($imgTSConfig);
```

Das Bild wird bereits korrekt angezeigt, aber wie bekomme ich es mit der Perfect Lightbox2 vergrößert?

Viele Grüße,
Euer Axel

## Antworten

### [#2](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/2) · ThBodi · 2008-08-19

rtfm: <http://typo3.org/documentation/document-library/extension-manuals/perfectlightbox/2.2.3/view/1/6/#id3999895>

### [#3](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/3) · axel___ · 2008-08-19

Soweit war ich auch schon, aber ich bekomme es im PHP-Code einfach nicht hin :-(

### [#4](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/4) · ThBodi · 2008-08-19

So sollte es gehen:

```php
$imgTSConfig = array();
$imgTSConfig['altText'] = '';
$imgTSConfig['titleText'] = '';
$imgTSConfig['file.']['maxW'] = 120;
$imgTSConfig['file.']['maxH'] = 120;
$imgTSConfig['file'] = 'uploads/pics/test.jpg';

$tmpConf['file'] = $imgTSConfig['file'];
$tmpConf['file.']['maxW'] = 600;
$tmpConf['file.']['maxH'] = 600;

$imgTSConfig['typolink.']['parameter.']['cObject'] = $this->cObj->IMG_RESOURCE($tmpConf);
$imgTSConfig['typolink.']['ATagParams'] = 'rel="lightbox"';

return $this->cObj->IMAGE($imgTSConfig);
```

### [#5](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/5) · axel___ · 2008-08-19

Hat leider nicht geklappt, ich mache es jetzt so:

```php
$imgTSConfig = array();
$imgTSConfig['altText'] = '';
$imgTSConfig['titleText'] = '';
$imgTSConfig['file.']['maxW'] = 120;
$imgTSConfig['file.']['maxH'] = 120;
$imgTSConfig['file'] = 'uploads/pics/test.jpg';
$imgTSConfig['wrap'] = "<a href=\"".$imgTSConfig['file']."\"  rel=\"lightbox[lb3]\">|</a>";
return $this->cObj->IMAGE($imgTSConfig);
```

### [#6](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/6) · ThBodi · 2008-08-20

Vermutlich geht es so:

```php
$imgTSConfig = array();
$imgTSConfig['altText'] = '';
$imgTSConfig['titleText'] = '';
$imgTSConfig['file.']['maxW'] = 120;
$imgTSConfig['file.']['maxH'] = 120;
$imgTSConfig['file'] = 'uploads/pics/test.jpg';

$tmpConf['file'] = $imgTSConfig['file'];
$tmpConf['file.']['maxW'] = 600;
$tmpConf['file.']['maxH'] = 600;

$imgTSConfig['typolink.']['parameter'] = $this->cObj->IMG_RESOURCE($tmpConf);
$imgTSConfig['typolink.']['ATagParams'] = 'rel="lightbox"';

return $this->cObj->IMAGE($imgTSConfig);
```

### [#7](https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension/7) · Philipp88 · 2012-02-28

Hallo,

sorry das ich das Thema wieder ausgrabe, hab aber genau das selbe Problem das ich die nicht in der eignen Extension nutzen kann:(

Mein Code:

```php
 foreach ($foto_array as $i => $foto)
         {
         $imgTSConfig = Array();
         // Bild-Pfad komplettieren
         $imgTSConfig['file'] = 'uploads/tx_imokat/' .$foto;


          // Bild Formatieren + Bild zurechtstutzen
          if($i==0) {
            $imgTSConfig['file.']['width'] = 300;
          } else {
            $imgTSConfig['file.']['width'] = 100;
            $imgTSConfig['file.']['height'] = 70;
          }
        }
        
        ###lightbox###
        $tmpConf['file'] = $imgTSConfig['file'];
        $tmpConf['file.']['maxW'] = 600;
        $tmpConf['file.']['maxH'] = 600;

        $imgTSConfig['typolink.']['parameter'] = $this->cObj->IMG_RESOURCE($tmpConf);
        $imgTSConfig['typolink.']['ATagParams'] = 'rel="lightbox"';

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

Die Bilder werden nicht verlinkt:(

Kann mir bitte einer helfen?

---

Quelle: „perfectlightbox in eigener Extension“, typo3.net, https://www.typo3.net/d/80825-perfectlightbox-in-eigener-extension
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
