I keep getting a "foreach warning" for this code:
- Code: Select all
<header>
<?php if(isset($this->item->editLink)): ?>
<a class="catItemEditLink modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>"> <?php echo JText::_('K2_EDIT_ITEM'); ?> </a>
<?php endif; ?>
<h2>
<!-- START: Call to prepare extra fields -->
<?php
//convertArray to use ids as key
$extrafields = array();
foreach($item->extra_fields as $extraFlds)
{
$extrafields[$extraFlds->id] = $extraFlds->value;
}
?>
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>"><?php echo $this->item->title; ?></a></br>
<a href="<?php echo $this->item->link; ?>"><?php echo $extrafields[13];?></a>
<?php else: ?>
<?php echo $this->item->title; ?>
<?php endif; ?>
<?php if($this->item->params->get('catItemFeaturedNotice') && $this->item->featured): ?>
<sup><?php echo JText::_('K2_FEATURED'); ?></sup>
<?php endif; ?>
</h2>
</header>
As for now it's in the header, but as soon as I got it working I will put it under as a description.
Thank you,
Regards