Thanks calguy1000
Used as suggested:
Code: Select all
<a href="{CGSmartImage src1="$entry->file_location" src2="$entry->fields.photo1->value" width=900 noembed=1}">
{CGSmartImage src1="$entry->file_location" src2="$entry->fields.photo1->value" width=180}
</a>
Thumbnail is on main stock page and when clicked, the correct (detail) page opened but the content is unstyled and no photos evident.
When I checked page source, it showed the following error:
Code: Select all
<a href="<br />
<b>Catchable fatal error</b>: Object of class stdClass could not be converted to string in ....<b> /tmp/templates_c/^6c8b9d4ace12834e672408708d31fd02650ce164.module_db_tpl.Products;detail_ammodetails.php</b> on line <b>58</b><br />
which is
Code: Select all
<a href="<?php echo CGSmartImage::function_plugin(array('src1'=>((string)$_smarty_tpl->tpl_vars['entry']->value)."->file_location",'src2'=>((string)$_smarty_tpl->tpl_vars['entry']->value)."->fields.photo1->value",'width'=>900,'noembed'=>1),$_smarty_tpl);?>
">
<?php echo CGSmartImage::function_plugin(array('src1'=>((string)$_smarty_tpl->tpl_vars['entry']->value)."->file_location",'src2'=>((string)$_smarty_tpl->tpl_vars['entry']->value)."->fields.photo1->value",'width'=>180),$_smarty_tpl);?>
</a>
The main stock page has the thumbnail and the detail page has a series of thumbnails including the one on the main page, all of which should open to a large image when clicked. The code given in my first post achieves this but obviously I need to get to grips with CGSmartImage so I can use it for this site and others in the future.
Thanks!
[Later]
I should mention that there is an option for up to 12 images - so Photo1 through to Photo12. Does this need to be set up on each <li> or is it possible to use a <foreach>?
Code: Select all
<div id="imagebox">
<ul class="img">
<li><div>
<a href="{CGSmartImage src1="$entry->file_location" src2="$entry->fields.photo1->value" width=900 noembed=1}">
{CGSmartImage src1="$entry->file_location" src2="$entry->fields.photo1->value" width=100}
</a></div></li>
... up to Photo12....
</ul></div>
Also, in Products module Prefs, do I leave that blank or fill in the sizes of the thumbnail and preview image (which I am assuming is the larger image)?