Code: Alles auswählen
<?
$cat = OOCategory::getCategoryById($this->getValue(category_id));
$cats = $cat->getChildren();
asort($cats);
if (is_array($cats))
{
foreach ($cats as $cat)
{
$catId = $cat->getId();
$catName = $cat->getName();
$article = $cat->getArticles();
if (is_array($article))
{
foreach ($article as $var)
{
$articleId = $var->getId();
$articleName = $var->getName();
$articleDescription = $var->getDescription();
$teaserbild = $var->_art_file;
$keywords = $var->_art_keywords;
$count++;
if($count == 3 || $count == 6 || $count == 9 || $count == 12 || $count == 15 || $count == 18) {
print '<div class="boxLast">'; }
else {
print '<div class="box">';
}
print '<a href="'.rex_getUrl($articleId).'"><img src="files/'.$teaserbild.'" alt="'.$keywords.'"/></a>';
print '</div>';
}
}
}
}
?>
Struktur:
- Hauptkategorie
--- Unterkategorie
------ Artikel
------ Artikel
--- Unterkategorie
--- Unterkategorie