[TYPO3-UG Freiburg] Bilder aus media in zufälliger Reihenfolge
Surena Golijani
golijani at homepagefarmer.de
Sat Sep 24 14:08:50 CEST 2011
steht das cObj (in $newcontent .=
$GLOBALS['TSFE']->cObj->IMAGE($mainimg); ) denn überhaupt zur Verfügung
(var_dump( $GLOBALS['TSFE']->cObj))?
Gruß, Surena
Am 24.09.2011 13:56, schrieb Ben Robinson:
> Klappt leider noch nicht.
>
> Aktuelles Script:
> -------------
> page.10.subparts.FRONTISPIECE = TEXT
> page.10.subparts.FRONTISPIECE{
> data = LEVELMEDIA:-1, slide
> postUserFunc = user_frontispiece
> postUserFunc.mainImg.maxW = 300
> }
>
> <?php
> function user_frontispiece($content,$conf) {
> $newcontent = "";
> $path = "/uploads/media/";
> $images = explode(",", $content);
>
> $newcontent .= var_dump($conf);
>
> // Bilder in Zufallsreihenfolge bringen
> shuffle($images);
>
> // alle Dateinamen testweise ausgeben
> foreach($images as $image){
> $newcontent .= $image."<br />";
> }
>
> // erstes Bild darstellen
> $mainimg = $conf['mainImg'];
> $mainimg['file.'] = $path.$images[0];
> $newcontent .= $GLOBALS['TSFE']->cObj->IMAGE($mainimg);
>
> return $newcontent;
> }
> ?>
> -------------
>
> var_dump sagt:
> array(1) { ["mainImg."]=> array(1) { ["maxW"]=> string(3) "300" } }
>
> Noch eine Idee?
>
> Gruß
> Ben
>
>
>
>
> Am 24.09.2011 um 13:37 schrieb Nicolas de Haen:
>
>> Stimmt, du hast $conf ja als Parameter zur Verfügung, also nicht $this->conf sondern einfach nur $conf.
>> Gib den doch mal mit var_dump($conf) aus. Normal kannst du da Typoscript übergeben:
>> Z.B.:
>>
>> page.10.subparts.FRONTISPIECE{
>> data = LEVELMEDIA:-1, slide
>> postUserFunc = user_frontispiece
>>
>> postUserFunc.mainImg{
>> maxW = 300
>> }
>> }
>>
>>
>> dann in PHP:
>>
>> $mainimg = $conf['mainImg'];
>> $mainimg['file.'] = $path.$images[0];
>>
>>
>> Gruß,
>> Nico
>>
>>
>> _______________________________________________
>> TYPO3-UG-Freiburg mailing list
>> TYPO3-UG-Freiburg at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-ug-freiburg
> _______________________________________________
> TYPO3-UG-Freiburg mailing list
> TYPO3-UG-Freiburg at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-ug-freiburg
>
>
>
--
Karl-Schmidt-Str. 2A, 79312 Emmendingen
Tel.: 0160 - 18 48 98 6 USt.IdNr: DE257578261
www.homepagefarmer.de <http://www.homepagefarmer.de>
/WebDesign | Neubau - Modernisierung - Optimierung/
More information about the TYPO3-UG-Freiburg
mailing list