Ich bin dabei eine Download Section auf einer Seite einzurichten und bin auf ein Problem gestoßen. Die Download Sektion soll auf dem News Modul basieren, d.h. es gibt eine Kategorie in der für jeden Download ein Artikel mit Beschreibung, link, etc erstellt wird. Das News Modul soll dann eine Übersicht über die vorhandenen Download items erstellen.
Der Dateiname für den Download, sowie Dateigröße und Accessbeschränkung werden dabei in jedem Artikel in über extra Modul Download_Item gespeichert:
Input:
Code: Alles auswählen
?><?php
echo '<table>
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("filename").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[1]" value="CMS_VALUE[1]"></td>
</tr>';
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("filesize").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[2]" value="CMS_VALUE[2]"></td>
</tr>';
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("public access").':</td>
<td style="padding:5px;">
<select name="CMS_VAR[3]">
<option value="public">yes</option>
<option value="internal">no</option>
</select></td>
</tr>';
echo '</table>';
?><?php
Code: Alles auswählen
<?php
if (!isset($tpl) || !is_object($tpl)) {
$tpl = new Template();
}
$tpl->reset();
$tpl->set('s', 'FILENAME', "CMS_VALUE[1]");
$tpl->set('s', 'FILESIZE', "CMS_VALUE[2]");
$tpl->set('s', 'ACCESS', "CMS_VALUE[3]");
$tpl->generate('templates/download_item.html');
?>
Code: Alles auswählen
$tpl->set('d', 'HEADLINE', $teaserheadline);
$tpl->set('d', 'TEXT', $teasertext);
$tpl->set('d', 'HREF', $href);
$tpl->set('d', 'IMG', $teaser_img);
$tpl->set('d', 'MORE', mi18n("more"));
Code: Alles auswählen
$filename=$article->getContent('CMS_VALUE', 1);
$filesize=$article->getContent('CMS_VALUE', 2);
$fileaccess=$article->getContent('CMS_VALUE', 3);
$tpl->set('d', 'HEADLINE', $teaserheadline);
$tpl->set('d', 'TEXT', $teasertext);
$tpl->set('d', 'HREF', $href);
$tpl->set('d', 'IMG', $teaser_img);
$tpl->set('d', 'MORE', mi18n("more"));
$tpl->set('d', 'FILENAME', $filename);
$tpl->set('d', 'FILESIZE', $filesize);
$tpl->set('d', 'ACCESS', $fileaccess);
Nun frag ich mich was ich daran falsch mache, oder ob es grundsätzlich nicht möglich ist die CMS_VALUE auf diese Weise auszulesen?!
Gruß
Martin