-
3.5.28 cal_default
Hallo liebe Community,
vielleicht könnt ihr mir weiterhelfen.
Ich habe einen Kalender erstellt mit Informationen im Teaser und einen Detail Eintrag (es ist immer nur ein Eintrag).
Ist es möglich den Teaser und den Detaileintrag am Kalender ersichtlich zu machen?
Ich kenne mich in PHP nicht so gut aus.
Würde jemand mir die Codezeilen bitte bitte schreiben
Danke
cal_default.html5/ cal_default.xhtml
PHP-Code:
<table class="calendar">
<thead>
<tr>
<th colspan="2" class="head previous"><?php if ($this->prevHref): ?><a href="<?= $this->prevHref ?>" title="<?= $this->prevTitle ?>"><?= $this->prevLink ?></a><?php else: ?> <?php endif; ?></th>
<th colspan="3" class="head current"><?= $this->current ?></th>
<th colspan="2" class="head next"><?php if ($this->nextHref): ?><a href="<?= $this->nextHref ?>" title="<?= $this->nextTitle ?>"><?= $this->nextLink ?></a><?php else: ?> <?php endif; ?></th>
</tr>
<tr>
<?php foreach ($this->days as $i=>$day): ?>
<th class="label<?= $day['class'] ?>"><?= utf8_substr($day['name'], 0, $this->substr) ?><span><?= utf8_substr($day['name'], $this->substr) ?></span></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($this->weeks as $class=>$week): ?>
<tr class="<?= $class ?>">
<?php foreach ($week as $day): ?>
<td class="<?= $day['class'] ?>">
<div class="header"><?= $day['label'] ?></div>
<?php foreach ($day['events'] as $event): ?>
<div class="event cal_<?= $event['parent'] ?><?= $event['class'] ?>">
<a href="<?= $event['href'] ?>" title="<?= $event['title'] ?> (<?php if ($event['day']) echo $event['day'] . ', '; ?><?= $event['date'] ?><?php if ($event['time']) echo ', ' . $event['time']; ?>)"<?= $event['target'] ?>><?= $event['link'] ?></a>
</div>
$teaser
<?php endforeach; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
-
Schreibt das Template nicht nur einen normalen Kalender? Wenn Du sehen willst was noch an Daten in das Template geworfen wird, dann schreibe am Anfang
PHP-Code:
<?php $this->showTemplateVars(); ?>
Vielleicht ist ja dort der Teaser und ein Hinweis (more oder Ähnliches) auf den kompletten Event drin.
Kurz zum Verständnis von PHP:
PHP-Code:
<?= $variable ?>
Gibt den Inhalt der PHP-Variable $variable aus.
PHP-Code:
<?php if ($variable): ?>
xxxx
<?php endif; ?>
Wenn die PHP-Variable $variable Daten enthält, dann führe die Anweisungen xxxx aus. Das endif beendet den Block.
PHP-Code:
<?php foreach ($variable as $item): ?>
xxxx
<?php endforeach; ?>
Gehe das Array $variable Wert für Wert durch und trage den jeweiligen Wert in die Variable $item ein. Führe danach jedesmal die Anweisungen xxxx aus. endforeach beendet die Schleife bzw. setzt die Ausführung fort, bis das ganze Array durchlaufen wurde.