News-Latest Template: Teserbox komplett verlinken
Servus zusammen,
ich suche nach einer Möglichkeit den gesamten Newsteaser zu verlinken, also nicht blos das Bild oder nur die headline. Hier meine news-latest-template-datei:
Code:
<div class="layout_latest arc_<?= $this->archive->id ?> block<?= $this->class ?>">
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?= $this->datetime ?>"><?= $this->date ?></time> <?= $this->author ?> <?= $this->commentCount ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?= $this->floatClass ?>"<?php if ($this->margin): ?> style="<?= $this->margin ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php else: ?>
<a href="<?php echo $this->link; ?>" title="<?php echo $this->newsHeadline; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>" />
</a>
<?php if ($this->caption): ?>
<figcaption class="caption"><?= $this->caption ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<div class="teaser_box">
<h2><?= $this->linkHeadline ?></h2>
<h3><?= $this->subheadline ?></h3>
<div class="teaser">
<?= $this->teaser ?>
</div>
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more"><?= $this->more ?></p>
<?php endif; ?>
</div><!-- end teaser_box -->
</div>
Also es müsste ein Link-Element um das Main-div gelegt werden. Aber mit a href="<?php echo $this->href; ?>... funktioniert das nicht
Könnt ihr mir helfen?
Liste der Anhänge anzeigen (Anzahl: 1)
Okay hier nun mein Code mit eigefügter Template-Variable:
HTML-Code:
<div class="layout_latest arc_<?= $this->archive->id ?> block<?= $this->class ?>">
[B]<a href="<?php echo $this->link; ?>">[/B]
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?= $this->datetime ?>"><?= $this->date ?></time> <?= $this->author ?> <?= $this->commentCount ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?= $this->floatClass ?>"<?php if ($this->margin): ?> style="<?= $this->margin ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php else: ?>
<a href="<?php echo $this->link; ?>" title="<?php echo $this->newsHeadline; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>" />
</a>
<?php if ($this->caption): ?>
<figcaption class="caption"><?= $this->caption ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<div class="teaser_box">
<h2><?= $this->linkHeadline ?></h2>
<h3><?= $this->subheadline ?></h3>
<div class="teaser">
<?= $this->teaser ?>
</div>
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more"><?= $this->more ?></p>
<?php endif; ?>
</div><!-- end teaser_box -->
[B]</a>[/B]
</div>
Das a-Tag in der 2. und vorletzten Zeile soll den gesamten Teaser verlinken. Tut er aber nicht (siehe Bild im Anhang). Ist bestimmt nur eine Kleinigkeit, aber mit php kenne ich mich leider nicht aus. Man sieht auch, dass der Link richtig gesetzt wird.
Anhang 17798