I am wondering if anyone knows how to add field definitions, that have been created within the Product Module into the Detail Template of the products module.
There is multiple field definitions which I have created, some are text and some are images.
An example of how I have tried to do this with one of the field definitions which is an image is below.
{if count($entry->fields)}
{foreach from=$entry->fields key='name' item='field'}
{if $field->type == 'image' && isset($field->image_box)}
file_location}/{$field->image_box}" width="100%" alt="{$field->value}"/>
{/if}
{/foreach}
{/if}
'image_box' is the field definitions is the name I defined in the properties for creating a new field definitions.
Product Module - Field Definitions - Problem
Re: Product Module - Field Definitions - Problem
Here's how I did it - i wanted to pull out the individual fields and wrap them in their own html so:
Try {$field->image_box} as {$entry->fields.image_box->value}
I'm reasonably sure that this just works out of the box for FDs in Product Manager - I don't recall having to wrote any other code to make this happen but apologies if it's on the wrong track.
Thanks once again to calguy1000.
Code: Select all
<div class="product_detail_field">
<span class="detail_field_label">Location: </span><span class="detail_field_value">{$entry->fields.Location->value}</span><br /><br />
<span class="detail_field_label">Date: </span><span class="detail_field_value">{$entry->fields.Date->value}</span><br />
I'm reasonably sure that this just works out of the box for FDs in Product Manager - I don't recall having to wrote any other code to make this happen but apologies if it's on the wrong track.
Thanks once again to calguy1000.