Metamodel 1:
mm_eintraege
Titel (titel), Beschreibung (beschreibung) und Kategorie (kategorie (Select-Feld))
Metamodel 2:
mm_kategorie
Titel (titel) und Alias (alias)
Detail-Template:
Code:
<?php if (count($this->data)): /* display only if there is data. */ ?>
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="<?php echo $arrItem['class']; ?>">
<h1><?php echo $arrItem['text']['titel']; ?> – <?php echo $arrItem['text']['kategorie']; ?></h1>
<?php echo $arrItem['text']['beschreibung']; ?>
</div>
<?php if ($arrItem['jumpTo']): ?><?php endif; ?>
<?php endforeach; /* item loop */ ?>
<?php else: /* no items found */ ?><p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>
Relateds-Template:
Code:
<?php $strRendersettings = ($this->settings)? 'settings' : 'view'; ?>
<?php if (count($this->data)): ?>
<?php foreach ($this->data as $arrItem): ?>
<?php
$objList = new MetaModels\ItemList();
$objList
->setMetaModel(ID-ChildModel, ID-Rendersetting-ChildModel)
->setTemplateFormat($this->getFormat())
->setFilterParam(ID-FilterSetting-ChildModel, array('parent' => array('value' => $arrItem['raw']['id'])), array())
->prepare();
echo $objList->render(false, $this); ?>
<div class="item <?php echo $arrItem['class']; ?>">
<?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
<div class="<?php echo $arrItem['class']; ?>">
<h1><?php echo $arrItem['text']['titel']; ?> – <?php echo $arrItem['text']['kategorie']; ?></h1>
</div>
<?php if ($arrItem['jumpTo']): ?><?php endif; ?>
<?php endforeach; /* item loop */ ?>
<?php else: ?>
<p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>
SQL-Filter:
Eigenes-SQL – Aktiviert
Code:
SELECT id FROM {{table}} Where pid = {{param::get?name=kategorie}}
Lesezeichen