Ich habe versucht ein Array aus Taxonomie im catalog_reader auszugeben und Icons zuzuweisen (wie im Wiki beschrieben). Irgendwie will das aber nicht (Warning: Invalid argument supplied for foreach ). Hat jemand eine Idee, wo es hakt?
Code:
<?php if (count($this->entries)): ?>
<div class="layout_full">
<?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; ?>
<?php if ($entry['data']['barrierefreiheit']['value']): ?>
<div id="barrierefreiheit">
<p>
<?php
$icons=array(
// Schema: 'id' => 'zu generierender Code',
'0' => '<img src="tl_files/bilder/icons/0.png" width="40" height="40" alt="55" title="">',
'1' => '<img src="tl_files/bilder/icons/1.png" width="40" height="40" alt="56" title="">',
'2' => '<img src="tl_files/bilder/icons/2.png" width="40" height="40" alt="57" title="">',
'3' => '<img src="tl_files/bilder/icons/3.png" width="40" height="40" alt="58" title="">',
'4' => '<img src="tl_files/bilder/icons/4.png" width="40" height="40" alt="59" title="">',
'5' => '<img src="tl_files/bilder/icons/5.png" width="40" height="40" alt="60" title="">',
'6' => '<img src="tl_files/bilder/icons/6.png" width="40" height="40" alt="61" title="">',
'7' => '<img src="tl_files/bilder/icons/7.png" width="40" height="40" alt="62" title="">',
'8' => '<img src="tl_files/bilder/icons/8.png" width="40" height="40" alt="63" title="">',
'9' => '<img src="tl_files/bilder/icons/9.png" width="40" height="40" alt="64" title="">',
'10' => '<img src="tl_files/bilder/icons/10.png" width="40" height="40" alt="65" title="">',
'11' => '<img src="tl_files/bilder/icons/11.png" width="40" height="40" alt="66" title="">',
'12' => '<img src="tl_files/bilder/icons/12.png" width="40" height="40" alt="67" title="">',
'13' => '<img src="tl_files/bilder/icons/13.png" width="40" height="40" alt="80" title="">'
);
foreach($entry['data']['barrierefreiheit']['value'] as $info)
echo $icons[$info['id']];
?>
</p>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p class="info"><?php echo $this->noItemsMsg; ?></p>
<?php endif; ?>
Kommentar