I can't get it to work. My code looks like this. But what I get is no item at all. Any suggestions?:
<?php if ($this->item->featured) : ?> <?php foreach($this->secondary as $key=>$item): ?> <?php // Define a CSS class for the last container on each row if( (($key+1)%($this->params->get('num_secondary_columns'))==0) || count($this->secondary)<$this->params->get('num_secondary_columns') ) $lastContainer= ' itemContainerLast'; else $lastContainer=''; ?> <div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->secondary)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_secondary_columns'), 1).'%;"'; ?>> <?php // Load category_item.php by default $this->item=$item; echo $this->loadTemplate('item'); ?> </div> <?php if(($key+1)%($this->params->get('num_secondary_columns'))==0): ?> <div class="clr"></div> <?php endif; ?> <?php endforeach; ?> <?php endif; ?>
Terry A Britton said:
Yes it is possible, if you are comfortable with php. Duplicate the code that calls each item (the foreach statement) and surround each chunk of code as follows. You should do this in template overrides.
<?php if ($this->item->featured) : ?>
first chunk of code
<?php endif; ?>
<?php if !($this->item->featured): ?>
second chunk of code
<?php endif; ?>