Hallo,
auf einer Seite sollen 3 Blöcke nebeneinander dargestellt werden.
Im ersten Block Events (Template event_teaser), im zweiten und im dritten jeweils ein unterschiedliches Newsarchiv (Template jeweils news_short).
Klappt im Prinzip wunderbar, nur wird immer der gleiche Teasertext in allen 3 Blöcken angezeigt, nämlich der des ersten Blocks.
Dabei ist es egal ob es sich um einen Event oder ein Newsarchiv handelt.
Ich habe beide Templates abändern müssen, vor allem wegen dem Datumsformat.
Eventuell habe ich hier einen Fehler gemacht.
Könnt Ihr bitte einmal drüber schauen?
Vielen Dank schon mal im Voraus.
Hier das Template "event_teaser":
PHP-Code:
<div class="layout_short event layout_teaser<?php echo $this->classList; ?>">
<div class="leftside">
<div class="cat_image"><!-- KATEGORIEBILD --></div>
<?php if ($this->time || $this->span): ?>
<div class="info">
<p class="date">
<?php
$dateFormatHuman = "d.m.Y";
$timeFormatHuman = "H:i";
$oneMinuteToMidnight = date_format(date_create('2000-01-01 23:59:01'), $timeFormatHuman);
$startDateHuman = $this->parseDate($dateFormatHuman,$this->startTime);
$startTimeHuman=$this->parseDate($timeFormatHuman,$this->startTime);
$endDateHuman=$this->parseDate($dateFormatHuman,$this->endTime);
$endTimeHuman=$this->parseDate($timeFormatHuman,$this->endTime);
if ($startDateHuman == $endDateHuman) {
if ($endTimeHuman == $oneMinuteToMidnight) {
// Single day, no times
echo "<span class='date'>$startDateHuman</span>";
} else {
if ($startTimeHuman == $endTimeHuman) {
// Single day with start time only
echo "<span class='date'>$startDateHuman</span> <br /> <span class='time'>$startTimeHuman</span>";
} else {
// Single day with start and end times
echo "<span class='date'>$startDateHuman</span> <br /> <span class='time'>$startTimeHuman – $endTimeHuman</span>";
}
}
} else {
if (($endTimeHuman == $oneMinuteToMidnight) || $startTimeHuman == $endTimeHuman) {
// Multiple day, no times or whole days
echo "<span class='date'>$startDateHuman – $endDateHuman</span>";
} else {
// Multiple day with times
echo "<span class='date'>$startDateHuman <span class='time'>($startTimeHuman)</span>
– $endDateHuman <span class='time'>($endTimeHuman)</span></span>";
}
};?>
</p>
</div>
<?php endif; ?>
</div>
<div class="rightside">
<?php if ($this->details): ?>
<h2>
<a href="<?php echo $this->href; ?>"
title="<?php echo $this->title; ?> (<?php if ($this->day): echo $this->day; ?>,
<?php endif; echo $this->date; if ($this->time): ?>, <?php echo $this->time; endif; ?>)"<?php echo $this->target; ?>>
<?php echo $this->link; ?></a>
</h2>
<?php else: ?>
<h2><?php echo $this->title; ?></h2>
<?php endif; ?>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->details): ?>
<p class="more"><a href="<?php echo $this->href; ?>" title="<?php echo $this->readMore; ?>"<?php echo $this->target; ?>><?php echo $this->more; ?> <span class="invisible"><?php echo $this->link; ?></span></a></p>
<?php endif; ?>
</div>
</div>
Und hier das Template "news_short":
PHP-Code:
<div class="layout_short block<?php echo $this->class; ?>">
<div class="leftside">
<div class="cat_image"><!-- KATEGORIEBILD --></div>
<?php if ($this->hasMetaFields): ?>
<div class="info">
<time datetime="<?php echo $this->datetime; ?>">
<span class="day"><?php echo $this->parseDate('d', $this->timestamp); ?>.</span>
<span class="month"><?php echo $this->parseDate('m', $this->timestamp); ?>.</span>
<span class="year"><?php echo $this->parseDate('Y', $this->timestamp); ?></span></time>
</div>
<?php endif; ?>
</div>
<div class="rightside">
<h2><?php echo $this->linkHeadline; ?></h2>
<div class="teaser">
<?php echo $this->teaser; ?>
</div>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
</div>
Lesezeichen