Catalog - List / Array / Ausgabe doppelter Werte verhindern
Guten Abend,
ich möchte ein mehrdimensionales Array auf doppelte Werte prüfen und nur unique Content ausgeben.
Zu prüfender Wert wäre z.B. $entry['data']['Kuenstlerprofil]['value'];
Wenn die Schleife läuft kann es z.B. sein, das der Wert 5x identisch ist. Folglich werden 5 komplette Ansichten um diesen Wert generiert. Ich brauche aber jeweils nur einen.
array_unique wäre der Beschreibung nach passend, aber ich weiß nicht wohin damit?!
PHP-Code:
<?php if (count($this->entries)): ?>
<div>
<?php foreach ($this->entries as $entry): ?>
<div class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
<?php if($entry['linkEdit']): ?><?php echo $entry['linkEdit']; ?><?php endif; ?>
<div class="werk"><?php echo $entry['data']['werk']['value']; ?></div>
<span class="Titel"><?php echo $entry['data']['Titel']['value']; ?> (<?php echo $entry['data']['Jahr']['value']; ?>)</span><br>
<?php echo $entry['data']['Technik']['value']; ?> / <?php echo $entry['data']['Abmessung']['value']; ?><br>
<?php echo $entry['data']['auflage']['value'];?>
<span>von
<?php foreach ($entry['data'] as $field=>$data): ?>
<?php if (strlen($data['raw']) && !in_array($field, array('catalog_name','parentJumpTo'))): ?>
<?php if (array_key_exists('ref', $data)): ?>
<?php foreach ($data['ref'] as $ref): ?>
<a href="<?php echo $ref['profil_url']; ?>"><?php echo $ref['Name']; ?></a></span>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
Bzw. kann ich alternativ mit dem filter_widget Template auch Werte aus einer anderen Tabelle abfragen?
<br><br>
<span class="preis"><?php echo $entry['data']['preis']['value']; ?> EUR</span>
<span class="kaufanfrage"><?php if ($entry['data']['verfuegbar']['value']=='ja'): ?><a title="" rel="lightbox nofollow" href="/kaufanfrage/items/<?php echo $entry['id'];?>.html?id=<?php echo $entry['id'];?>">Kaufanfrage</a><br><?php else: ?>bereits verkauft<br><?php endif; ?></span>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>