Page 1 of 1

[solved] Only display one field name in summary template - Products Module

Posted: Wed Aug 25, 2010 6:17 am
by ngoncom
Dear masters!

I get trouble when want display only one field in module products.

In module products, I create 2 field:

Image1 - Type: Image
Image2 - Type: Image

and in summary view, it display 2 image with this loop code:

{if isset($entry->fields)}
 {foreach from=$entry->fields key='name' item='field'}
      {if $field->type == 'image' && isset($field->thumbnail)}
        file_location}/{$field->thumbnail}" alt="{$field->value}"/>
      {/if}
 {/foreach}
{/if}


But I really want display field 1 (Image1), can I?

Thank masters!

Re: Only display one field name in summary template - Products Module

Posted: Wed Aug 25, 2010 1:54 pm
by maranc
Change:

{if $field->type == 'image' && isset($field->thumbnail)}

as bellow:

{if $field->type == 'image' && $field->name == 'Image1' && isset($field->thumbnail)}

Re: Only display one field name in summary template - Products Module

Posted: Thu Aug 26, 2010 8:41 am
by ngoncom
Thank Maranc very much!  ;D

My problem solved!