Hi,
es ist so, dass wir öfters Termine haben, die aufgeteilt sind auf mehrere Wochenenden. Dafür haben ich per DCA neue Event-Felder angelegt:
startDateB, endDateB etc.
Im event_upcoming-Template ließ sich das wunderbar einbauen, sodass die Zusatztermine in einer Tabelle dargestellt werden:
PHP-Code:
<tr class="event<?php echo $this->classUpcoming; ?>">
<td class="title"><a href="<?= $this->href ?>" title="<?= $this->title ?> (<?php if ($this->day) echo $this->day . ', '; ?><?= $this->date ?><?php if ($this->time) echo ', ' . $this->time;?>)"<?= $this->target ?>><?= $this->link ?>
<?php if ($this->startDateB): ?>(Teil 1)<?php endif; ?>
</a></td>
<td class="date"><?php echo $this->firstDate; ?> <?php if ($this->endDate): ?> –<br><?php echo $this->parseDate('d.m.Y', $this->endDate); ?> <?php endif; ?></td>
</tr>
<?php if ($this->startDateB): ?>
<tr class="event<?php echo $this->classUpcoming; ?>">
<td class="title"><a href="<?= $this->href ?>" title="<?= $this->title ?> (<?php if ($this->day) echo $this->day . ', '; ?><?= $this->date ?><?php if ($this->time) echo ', ' . $this->time;?>)"<?= $this->target ?>><?= $this->link ?> (Teil 2)</a></td>
<td class="date"><?php echo $this->parseDate('d.m.Y', $this->startDateB); ?> <?php if ($this->endDateB): ?> –<br><?php echo $this->parseDate('d.m.Y', $this->endDateB); ?> <?php endif; ?></td>
</tr>
<?php endif; ?>
Ich möchte auch den Contao-Kalender zur Übersicht nutzen und müsste dafür die cal_default.html5 anpassen, damit die zusätzlichen Termine angezeigt werden.
Ziel wäre also, dass auch startDateB und endDateB im Kalender beachtet werden. Ich weiß allerdings nicht, wie ansetzen; kann mir jemand weiterhelfen?
PHP-Code:
<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'] ?>" itemscope itemtype="http://schema.org/Event">
<a href="<?= $event['href'] ?>" title="<?= $event['title'] ?> (<?php if ($event['day']): ?><?= $event['day'] ?>, <?php endif; ?><?= $event['date'] ?><?php if ($event['time']): ?> <?= $event['time']?><?php endif; ?>)"<?= $event['target'] ?> itemprop="url"><span itemprop="name"><?= $event['link'] ?></span></a>
</div>
<?php endforeach; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
Vielen Dank i.V. für die Hilfe!
LG Michael
Lesezeichen