hier gleich mal, wie du mehrere bilder auslesen kannst und bei verwendung von perfectlightbox mit einem popup verbinden kannst (leider ist mir keine andere möglichkeit bekannt, als es so zu frikeln - aber vielleicht weiß jemand anderer etwas besseres):
<?php
#weitere Bilder aus Bildleiste einfuegen
$imgTeilen = $record['bilder'];;
$imgArray = explode(',', $imgTeilen);
foreach($imgArray as $imgAusgabe => $imgValue) {
#Bild verkleinern auf 150 bzw. 90 px und mit Perfectlightbox verbinden
$imgTSConfig = array();
$imgTSConfig['altText'] = $record['title'];
$imgTSConfig['titleText'] = $record['title'];
$imgTSConfig['file.']['maxW'] = 150;
$imgTSConfig['file.']['maxH'] = 90;
$imgTSConfig['file'] = 'uploads/formular/'.$imgValue;
$imgTSConfig['wrap'] = "<div style="\"float:" left="" padding-top:="" 1px="" padding-bottom:1px="" margin-right:="" 9px=""><a href="\"".$imgTSConfig1['file']."\"" rel="\"lightbox[lb3]\"">|</a></div>";
$img = $this->cObj->IMAGE($imgTSConfig);
$markerArray['###BILDER###'].= $img;
}
?>
bei kj image lightbox geht es einfacher - musst es halt im obigen code einbauen:
<?php
// check if lightbox ext. is installed and init
if (t3lib_extMgm::isLoaded('kj_imagelightbox2'))
{
$config['imageLightbox2'] = 1;
$config['imageLightbox2.']['caption'] = htmlentities($record['title']);
}
$img = $this->cObj->IMAGE($config);
$markerArray['###BILDER###']=$img;
?>
Was muss iich den erstmal tun? Ich habe keine Lightbox bis jetzt installiert?
perfectligbox oder kj imagelightbox2 installieren oder mit dem "normalen" pop-up arbeiten. dazu findest du im video-tutorial von kaspar eine anleitung: http://typo3.org/documentation/videos/wmv-format/#c2375 - ich glaub in Rendering The Image.
in Zeile 14 ist irgendwo ein Fehler. Finde ihn leide nicht.
Also ich installiere jetzt ein von den beiden Plugins und packe den Code rein. Dann müsste es gehen ja?
beim string muss du event. die " noch zum teil umbessern (hat es beim kopieren anscheinen nicht korrekt übernommen):
$imgTSConfig1['wrap'] = "<div style=\"float: left; padding-top: 1px; padding-bottom:1px; margin-right: 9px;\"><a href=\"".$imgTSConfig1['file']."\" rel=\"lightbox[lb3]\">|</a></div>";
wenn du das verwendest, musst du perfectlightbox installieren
Welche Lightbox sollte ich den lieber benutzen und welche ist einfacher einzubauen?
Habe nicht soviel ahnung wie das alles gehen soll hehe..
ist geschmackssache. ich habe die perfectlightbos lieber, da man auch diashows machen kann.
Also ich habe jetzt Perfect Lightbox2( perfectlightbox ) installiert. Mehrere Bilder aus einem Datenbankfeld zeigt der jetzt an. 😃
Leider funktioniert die Lightbox nicht. #angry#
$imgTeilen = $record['bilder'];;
$imgArray = explode(',', $imgTeilen);
foreach($imgArray as $imgAusgabe => $imgValue)
{
#Bild verkleinern auf 150 bzw. 90 px und mit Perfectlightbox verbinden
$imgTSConfig = array();
$imgTSConfig['altText'] = $record['title'];
$imgTSConfig['titleText'] = $record['title'];
$imgTSConfig['file.']['maxW'] = 150;
$imgTSConfig['file.']['maxH'] = 90;
$imgTSConfig['file'] = 'uploads/formular/'.$imgValue;
$imgTSConfig['wrap'] = "<div style=\"float: left; padding-top: 1px; padding-bottom:1px; margin-right: 9px;\"><a href=\"".$imgTSConfig1['file']."\" rel=\"lightbox[lb3]\">|</a></div>";
$img = $this->cObj->IMAGE($imgTSConfig);
$markerArray['###BILDER###'].= $img;
}
Er öffnet die Bilder, aber leider nicht in der Lightbox sondern in dem aktuellen Fenster.
guck mal im quelltext, ob das script für die lightbox ausgegeben wird. wenn ja, prüfe, ob eine andere extension mit mootools installiert ist und sich dadurch die scripte in die quere kommen. ansonsten schick mir mal die url (pn), dann kann ich mir das direkt ansehen.
Also eine andere Extension ist nicht installiert. Ich habe nur QUixplorer, Full Backup, Kommandzeile und Kickstarter installiert.
Habe es leider auf einem Sever liegen der keine Internetanbindung hat.
Wo im Quelltext muss ich den gucken?
im head sollte in etwa so was stehen:
<link rel="stylesheet" href="typo3conf/ext/perfectlightbox/res/css/slightbox.css" type="text/css" media="screen,projection" /><script type="text/javascript" src="typo3conf/ext/perfectlightbox/res/js/prototype-packed.js"></script>
<script type="text/javascript" src="typo3conf/ext/perfectlightbox/res/js/scriptaculousEffects-packed.js?load=effects"></script><script type="text/javascript" src="typo3conf/ext/perfectlightbox/res/js/lightbox-packed.js"></script><script type="text/javascript"> var borderSize = 10;
var resizeSpeed = 400;
var animate = true;
var overlayOpacity = 0.8;
var allowSave = false;
var enableSlideshowAutoplay = true;
var slideshowAutoclose = true;
var slideshowInterval = 5000;
var lllImage = 'Bild';
var lllOf = 'von';</script>
Der gibt nur das aus:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--
This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2008 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at http://typo3.com/ and http://typo3.org/
-->
<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_8192c2092f.css" />
<link rel="stylesheet" type="text/css" href="fileadmin/template/style.css" media="screen" />
<title>Test 2</title>
<meta name="generator" content="TYPO3 4.2 CMS" />
<script type="text/javascript" src="typo3temp/javascript_93077bb238.js"></script>
</head>
<body>
<div id="wrap">
<div id="lwrap">
<div id="menu"><ul><li><a href="test.html" title="Home" >Home</a></li><li><a href="testa.html" title="test1" >Test 1</a></li><li><a href="testim.html?&no_cache=1" title="Test2" >Test 2</a></li><li><a href="testap.html" title="Test 3" >Test 3</a></li><li><a href="testkt.html" title="test4" >Test 4</a></li></ul></div>
<div id="logo"><img src="fileadmin/images/logo2.png" alt="Logo" /></div>
</div>
<div id="trenner"><img src="fileadmin/images/trenner.jpg" alt="trenn" /></div>
<div id="inhalt">
<!-- CONTENT ELEMENT, uid:49/list [begin] -->
<a id="c49"></a>
<!-- Plugin inserted: [begin] -->
<!--
BEGIN: Content of extension "formular", plugin "formular_pi1"
-->
<div class="formular-pi1">
<h1>Detailansicht</h1>
<table border="1">
<tr>
<td width="100"><div class="rot">Person 1:</div></td><td width="300"><font size="2">Willi</font></td>
</tr>
<tr>
<td width="100"><div class="rot">Person 3:</div></td><td width="300"><font size="2">Bernd</font></td>
</tr>
<tr>
<td width="100"><div class="rot">Person 3:</div></td><td width="300"><font size="2">Hans</font></td>
</tr>
<tr>
<td width="100"><div class="rot">Person 4:</div></td><td width="300"><font size="2">Jürgen</font></td>
</tr>
<tr>
<td width="100"><br /></td>
</tr>
<tr>
<td width="100"><div class="rot">Bilder:<br /></div></td><td width="300"><font size="2"><div style="float: left; padding-top: 1px; padding-bottom:1px; margin-right: 9px;"><a href="uploads/formular/img_03.jpg" rel="lightbox[lb3]"><img src="typo3temp/pics/878ee2ae32.jpg" width="150" height="75" border="0" alt="" title="" /></a></div></font></td>
</tr>
</table>
<p><a href="testim.html?&no_cache=1" >Zurueck zur Personenansicht</a></p>
</div>
<!-- END: Content of extension "formular", plugin "formular_pi1" -->
<!-- Plugin inserted: [end] -->
<!-- CONTENT ELEMENT, uid:49/list [end] -->
</div>
<div id="rwrap">
<div id="verlauf"><img src="fileadmin/images/verlauf.jpg" alt="verlauf" /></div>
<div id="rechts"></div>
</div>
</div>
</body>
</html>
da ist perfectlightbox nicht korrekt eingebunden. guck mal, ob du im beim template das static template für perfectlightbox eingebunden hast:
template-> root template wählen -> "Click here to edit whole template record" -> bei "enthält" gucken ob bei "Statische einschließen (aus Erweiterungen)" auf der linken seite (ausgewählt) "Perfect Lightbox2" steht. wenn nicht, dann einfach auf der rechten seite bei "Objekte" anklicken, dann sollte links erscheinen. speichern nicht vergessen.
Super HILFE! DANKE!!! Das nenn ich ein geiles Forum. Es funktioniert.