Danke für die schöne Beschreibung. Nun wird auch etwas ausgegeben, aber leider aus meiner Sicht noch fehlerhaft.
Was habe ich denn falsch gemacht?
Datenbank
singleSRC = binary(16) NULL
DCA
PHP-Code:
'singleSRC' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_vorteilspartner']['singleSRC'],
'inputType' => 'fileTree',
'eval' => array('files'=>true, 'filesOnly'=>true, 'fieldType'=>'radio'),
'sql' => "binary(16) NULL"
),
Module.php
PHP-Code:
protected function compile()
{
$objVorteilspartner = Database::getInstance()
-> prepare('SELECT *
FROM tl_vorteilspartner
ORDER BY category')
-> execute($this->vorteilpartner_auswahl, 1);
$this->Template->vorteilspartner = $objVorteilspartner->fetchAllAssoc();
// Check for version 3 format
if (!is_numeric($this->singleSRC))
{
return '<p class="error">'.$GLOBALS['TL_LANG']['ERR']['version2format'].'</p>';
}
$objFile = \FilesModel::findByPk($this->singleSRC);
$this->singleSRC = $objFile->path;
}
Template
PHP-Code:
<?php foreach ($this->vorteilspartner as $vorteilspartner_element):
?>
<tr>
<td><img src="<?php echo $vorteilspartner_element['singleSRC']; ?>"></td>
<td><?php echo $vorteilspartner_element['name']; ?><br><?php echo $vorteilspartner_element['address']; ?></td>
<td><?php echo $vorteilspartner_element['description']; ?></td>
<td><?php echo $vorteilspartner_element['benefit']; ?></td>
<td><?php echo $vorteilspartner_element['category']; ?></td>
</tr>
<?php endforeach; ?>
Ausgabe im HTML-Code
HTML-Code:
<img src="files/pictures/r">
Lesezeichen