Kannst du denn andere Seiten als PDF ausgeben lassen?
Werde es vorerst mit CSS lösen.
<?php if (count($this->entries)): ?>
<?php $lastcat=''; ?>
<table class="layout_simpletable" summary="Catalog Items" cellspacing="0" cellpadding="0">
<tbody class="body<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
<?php foreach ($this->entries as $entry): ?>
<?php if ($lastcat!=$entry[data]['linklistneu_kat']['value']): ?>
<?php $lastcat=$entry[data]['linklistneu_kat']['value']; ?>
<tr class="linkkat" >
<th class="field <?php echo $field; ?>" ><?php echo $entry[data]['linklistneu_kat']['value']; ?></th>
</tr>
<?php endif; ?>
<tr class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>" >
<?php foreach ($entry['data'] as $field=>$data): ?>
<?php if ($field=='linklistneu_kat') continue; ?>
<?php if (!in_array($field, array('catalog_name','parentJumpTo'))): ?>
<td class="field <?php echo $field; ?>" ><?php echo $data['value']; ?></td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<?php if ($this->condition): ?>
<div class="condition"><?php echo $this->condition; ?></div>
<?php else: ?>
<p class="info">There are no entries matching your search.</p>
<?php endif; ?>
<?php endif; ?><?php if (count($this->entries)): ?>
<?php $lastcats=array(); ?>
<table class="layout_simpletable" summary="Catalog Items" cellspacing="0" cellpadding="0">
<tbody class="body<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
<?php foreach ($this->entries as $entry): ?>
<?php if (!in_array($entry['data']['linklistneu_kat']['value'], $lastcats): ?>
<?php $lastcats[]=$entry['data']['linklistneu_kat']['value']; ?>
<tr class="linkkat" >
<th class="field <?php echo $field; ?>" ><?php echo $entry['data']['linklistneu_kat']['value']; ?></th>
</tr>
<?php endif; ?>
<tr class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>" >
<?php foreach ($entry['data'] as $field=>$data): ?>
<?php if (!in_array($field, array('catalog_name','parentJumpTo', 'linklistneu_kat'))): ?>
<td class="field <?php echo $field; ?>" ><?php echo $data['value']; ?></td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<?php if ($this->condition): ?>
<div class="condition"><?php echo $this->condition; ?></div>
<?php else: ?>
<p class="info">There are no entries matching your search.</p>
<?php endif; ?>
<?php endif; ?>
<?php if (count($this->entries)): ?>
<?php
$fieldName = 'activity_gruppe'; // field name for creating collections
$arrCategories = array(); // collects all catalog entries
$arrSorted = array(); // collects all sorted catalog entries
$index = 0;
foreach($this->entries as $entry)
{
$act = $entry['data'][$fieldName]['value'];
// check if category already exists / or not
if( array_key_exists($act, array_flip($arrCategories) ) )
{
$arrSorted[$act][] = $entry; // fill existing category node
$index++;
}
else
{
if( !strlen($act) ) // Incase entry has no categorie selected, build free category
{
$act = 'Ohne Kategorie';
}
$arrSorted[$act][0] = $entry; // create new category node
}
$arrCategories[] = $entry['data'][$fieldName]['value'];
}
?>
<?php foreach($arrSorted as $k => $entries): ?>
<div class="team_cat"><?php echo $k; ?></div>
<?php foreach($entries as $entry): ?>
<div class="team_items <?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
<div class="team_image"><?php echo $entry['data']['photo']['value']; ?></div>
<div class="team_info"><?php echo $entry['data']['info']['value']; ?></div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
Kommentar