First, THANK YOU for showing us this and I am so close to figuring it out I can taste it.
What piece of code do I need to add to the product detail template to make the gallery functional for the custom drop down gallery field?
I have followed your instructions adding the textfield, module_custom/, get_gallery_dropdown, and revised editproduct.tpl. I am showing the dropdown in the product page and am now trying to add the actual gallery to my detail page.

Here is the code I am attempting:
Code: Select all
{*trying to add gallery in the product detail template *}
{assign var='products' value=$mod}
<div class="ProductDirectoryItem">
{* note: {content} must be called before the hierarchy view is called *}
{if $entry->hierarchy_ > 0}{$active_hierarchy=$entry->hierarchy_}{/if}
{if is_array($entry->breadcrumb)}
Breadcrumb: {' >> '|implode:$entry->breadcrumb}<br/>
{/if}
{* set a canonical url *}
{if $entry->detail_url != ''}{$canonical=$entry->detail_url}{/if}
{if $entry->details ne ''}
Details:<br />
{$entry->details}<br />
{/if}
{* uncomment the following line if the Promotions module is installed *}
{* promo_get_prod_discount product_=$entry-> assign='foo' *}
{if isset($foo.promo_)}
<span style="color: red;">Discount: {$currency_symbol}{$foo.discount|number_format:2} ({$foo.percentage|number_format:2}%)</span><br/>
{if $entry->price ne ''}
Price {$currency_symbol}: {$entry->price * $foo.decimal|number_format:2}per sq.ft.<br />
{/if}
{elseif $entry->price ne ''}
Price {$currency_symbol}: {$entry->price}<br />
{/if}
{* accessing all of the fields in a list *}
{if isset($entry->fields) && count($entry->fields)}
{foreach from=$entry->fields key='name' item='field'}
<div class="product_detail_field"><p>
{$name}: {$field->value}<br/>
{if $field->type == 'image' && isset($field->thumbnail)}
<a href="{$entry->file_location}/{$field->value}" target="_blank"> <img src="{$entry->file_location}/{$field->thumbnail}" /></a>
{/if}
</p></div>
{/foreach}
{/if}
{* print out attributes *}
{if isset($entry->attributes)}
<h4>Attributes</h4>
<table>
<thead>
<tr>
<th>Text</th>
<th>Sku</th>
<th>Adjustment</th>
</tr>
</thead>
<tbody>
{foreach from=$entry->attributes key='name' item='attrib'}
<tr>
<td>{$attrib.text}</td>
<td>{$attrib.sku}</td>
<td>{$attrib.adjustment}</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{* print out the categories *}
{if isset($entry->categories)}
{foreach from=$entry->categories item='category'}
<div class="product_detail_category"><p>
{* if there are data fields associated with this category, display them too *}
{if isset($category->data) && count($category->data)}
<div class="product_detail_category_fields">
<strong>{$Products->Lang('data')}</strong><br/>
{foreach from=$category->data item='onedataitem'}
<div class="product_detail_category_onefield">
{if $onedataitem.field_type == 'image'}
<a href="{$category->file_location}/{$onedataitem.field_value}"><img src="{$category->file_location}/thumb_{$onedataitem.field_value}" alt="thumb" /></a>
[glow] {elseif $onedataitem.field_type == 'gallery'}
{gallery dir="{$onedataitem.field_value}"}[/glow]
{elseif $onedataitem.field_type == 'file'}
<a href="{$category->file_location}/{$onedataitem.field_value}">{$onedataitem.field_value}</a>
{else}
{$onedataitem.field_value}<br/>
Breadcrumb: {breadcrumbs}<br />
{/if}
</div>
{/foreach}
</div>
{/if}
</p></div>
{/foreach}
{/if}
<div>
{* display the cart *}
{*Cart2 sku=$entry->sku*}
</div>
{* create a link back to the top of the page *}
{anchor anchor='product_name' text=$Products->Lang('return_to_top') title=$Products->Lang('return_to_top')}
</div>
Syntax error in template "module_db_tpl:Products;detail_sample2" on line 84 "{gallery dir="{$onedataitem.field_value}"}" unknown tag "gallery"
What I see when I remove the gallery portion in my code:

Any help would be greatly appreciated. I am such a fan of this CMS.