Page 1 of 1

[Shop made simple] Thumbnails of featured products

Posted: Thu Sep 02, 2010 7:49 pm
by zappodrom
Hi

I use CMSms 1.8.2 and Shop made simple for a little Website to display the articles and so on...
All worked fine so far. Thank you, Duketown, for the great Module!

My only problem is a little list of thumbnails from the featured products on the right side of my page. For "Featured products" I use the following Template:

Code: Select all

{foreach from=$products item=featentry}

{capture assign='thumb_img'}
  {$config_images_uploads_url}{$featentry->prodimage}
{/capture}

{image src=uploads/$thumb_img alt='Angebote von Stege Werbung'}{$image_uploads_url}
{/foreach}
The HTML-Source looks like this:

Code: Select all

<img src="http://neu.stegewerbung.de/uploads/images/uploads/  /products/11681_05.jpg" alt="FooBar" title="FooBar"/>
Is there a way to get the needed tn_ before the filename to make the code look like this?

Code: Select all

<img src="http://neu.stegewerbung.de/uploads/images/uploads/products/tn_11681_05.jpg" alt="FooBar" title="FooBar"/>
Thanks for reply!

Re: [Shop made simple] Thumbnails of featured products

Posted: Fri Sep 03, 2010 7:57 am
by zappodrom
Hi,

I've found the following code here. Is it possible to adapt this to my needs? I'm not familiar with regex so every help would be appreciated.

Code: Select all

{assign var='config' value=$gCms->GetConfig()}
{assign var='config_image_uploads_url' value=$config.image_uploads_url|regex_replace:'/\/+$/':''}

{foreach from=$products item=entry}
  <div style="padding-top:30px;">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td width="160">
  <div align="left">
 {capture assign='big_img'}{$config_image_uploads_url}{$entry->prodimage|regex_replace:'/\/+tn_([^\/]*)$/':'/$1'}{/capture}

--- Snip ---
It's look to me like the regex_replace does the magic. But it does'nt work for me...

Regards,
Zappodrom