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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ngoncom
Forum Members
Forum Members
Posts: 19
Joined: Fri Jun 11, 2010 7:55 am

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

Post 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!
Last edited by ngoncom on Thu Aug 26, 2010 8:42 am, edited 1 time in total.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

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

Post by maranc »

Change:

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

as bellow:

{if $field->type == 'image' && $field->name == 'Image1' && isset($field->thumbnail)}
ngoncom
Forum Members
Forum Members
Posts: 19
Joined: Fri Jun 11, 2010 7:55 am

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

Post by ngoncom »

Thank Maranc very much!  ;D

My problem solved!
Post Reply

Return to “Modules/Add-Ons”