-
Anpassung des Templates
Hallo,
ich bin habe angefangen das Template anzupassen und stehe nun vor einem "kleinen" Problem:
Ich bekomme immer nur den Link des ersten Eintrags ausgeworfen, die Bilder werden aber von allen Einträgen angezeigt. Ich möchte aber, dass alle Links untereinander ausgeworfen werden.
Ich hoffe es hat jemand einen Tipp für mich, wie ich die beiden Probleme lösen.
Danke schön
Code:
<?php if (count($this->data)): /* display only if there is data. */ ?>
<?php $arrItem = $this->data[0]; /* fetch first item for title columns. */ ?>
<div class="navigation_links">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['link']; ?></a>
</div>
<?php?>
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="navigation_pictures">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['bild']; ?></a>
</div>
<?php endforeach; /* item loop */ ?>
<?php endif; ?>
-
Versuch mal folgendes
Code:
<?php if (count($this->data)): /* display only if there is data. */ ?>
<?php $arrItem = $this->data[0]; /* fetch first item for title columns. */ ?>
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="navigation_links">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['link']; ?></a>
</div>
<div class="navigation_pictures">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['bild']; ?></a>
</div>
<?php endforeach; /* item loop */ ?>
<?php endif; ?>
Gesendet von meinem Xperia Z mit Tapatalk
-
Vielen Dank!
Eine Frage habe ich noch, ich wollte die Links in einem DIV haben und die Bilder in einem anderen DIV.
Links Bilder
Link1 Bild1
Link2 Bild2
Link3 Bild3
Gibt es hierfür auch noch eine Lösung?
Danke Stefan
-
Das könnte so funktionieren:
Code:
<?php if (count($this->data)): /* display only if there is data. */ ?>
<?php $arrItem = $this->data[0]; /* fetch first item for title columns. */ ?>
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="navigation_links">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['link']; ?></a>
</div>
<?php endforeach; /* item loop */ ?>
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="navigation_pictures">
<a href="<?php echo $arrItem['text']['link']; ?>"><?php echo $arrItem['html5']['bild']; ?></a>
</div>
<?php endforeach; /* item loop */ ?>
<?php endif; ?>