View Single Post
  #4  
Old 03-07-2009, 07:58 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: extra fields, assigning a variable, using more than one extra field

Not working yet.

--- is the var assign good for the enitre template, and nested templates further down the page?

For example:

the file, modules/Extra_Fields/product.tpl looks like:

Code:
{section name=field loop=$extra_fields} {if $extra_fields[field].field eq "Ingredients"} {if $extra_fields[field].field_value ne ""} {assign var="ingred" value=$extra_fields[field].field_value} {/if} {/if} {/section}

then in product.tpl (toward the top), I include the template:

Code:
{if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if}

so then, the var, {$ingred} should be propagated from here on within product.tpl, yes?

Should I be able to use the var like this, somewhere lower on the product.tpl page:

Code:
<img src="/product-images/ingredients/{$ingred}" />

Unfortunately, it's not working. {$ingred) simply comes back blank. Nothing there. AM I MISSING SOMETHING in assigning the var?

Thanks in advance for looking at this.

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote