Hallo,
ich baue gerade die Items im Caroufredsel von Metamodels auf eigene Inhaltselemente um, das template für die Metamodels Items sieht so aus:
PHP-Code:
<?php $strRendersettings = ($this->settings)? 'settings' : 'view'; ?>
<?php if (count($this->data)): ?>
<?php $intVariableFuerHochzaehlen=1; ?>
<?php foreach ($this->data as $arrItem): ?>
<div class="tile g<?php echo $intVariableFuerHochzaehlen; ?> <?php echo $arrItem['class']; ?>">
<a
<?php if ($arrItem['text']['kachelband_de_external_link'] == "1"){
echo 'target="_blank"';
} ?>
href="<?php echo $arrItem['text']['kachel_band_link']; ?>">
<h2><?php echo $arrItem['text']['kachel_band_headline']; ?></h2>
<p><?php echo $arrItem['text']['kachel_band_description']; ?></p>
</a>
</div>
<?php
$intVariableFuerHochzaehlen +=1;
if($intVariableFuerHochzaehlen == 10) $intVariableFuerHochzaehlen = 1;
?>
<?php endforeach; ?>
<?php else: ?>
<p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>
Wenn ich jetzt eigene Inhaltselemente verwende, habe ich ja keine "for schleife" mehr die hochzählt, sondern nur noch die Ausgabe von caroufredsel:
PHP-Code:
<div class="caroufredsel_skin" id="caroufredsel_skin_<?php echo $this->id; ?>">
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<div class="caroufredsel test" id="caroufredsel_<?php echo $this->id; ?>">
<?php echo implode('', $this->elements); ?>
</div>
Wie kann ich da so eine schleife bauen, die die Klassen der Divs hochzählt? BZW. die Items numeriren?
Lesezeichen