I want to expose my issue: I have created a float box in my website http://bitly.com/RbS092 I want to set up one image that come from viewlistning.php I dont know how could I limeted one image of 5 http://prntscr.com/gqd9e I think that not look good see five image aside in another side the same images This is the code that I have inserted into my float box: PHP: <div>{* This the image display portion *} {if $viewphotos=="Y" && $data <> ''} {foreach from=$data item=image} <a href="photos/{$image.image}" title="{$image.title}" class="thickbox" rel="gallery"><img src="thumbs/small_{$image.image}" alt="{$image.title}" /></a><br /><br /> {foreachelse} <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" /> {/foreach} {else} <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" /> {/if} {* This ends the image display portion *}</div> </div> Thanks in advance!
Off of the top of my head, I believe that you are actually looking for {$data.0.image}. Try that if it doesn't work, then use the smarty debug to find the available variables in the template.
Hi Mike thanks you for your replay, I could see one image but the image is repeated depending on the number of images that I have in the listing: look this http://prntscr.com/gr2qa How could I see one image. I tried to view in the debug but nothing seem to be related with that issue.
Hi Mike this is my code that I inserted into layout.tpl I dont see the loop that you said: PHP: <div>{if $viewphotos=="Y" && $data <> ''} {foreach from=$data item=image} <a href="photos/{$image.image}" title="{$image.title}" class="thickbox" rel="gallery"><img src="thumbs/small_{$data.0.image}" alt="{$image.title}" /></a><br /> {foreachelse} <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" /> {/foreach} {else} <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" /> {/if} {* This ends the image display portion *}</div> </div> I dont know how do it.
Maybe like this? Code: <div> {if $viewphotos=="Y" && $data <> ''} <a href="photos/{$image.image}" title="{$image.title}" class="thickbox" rel="gallery"> <img src="thumbs/small_{$data.0.image}" alt="{$image.title}" /> </a><br /> {else} <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" /> {/if} {* This ends the image display portion *} </div>
Thank you very much Mike, you are a genius in PHP thanks for your help, look the final job: http://prntscr.com/gt6bp