[Solved] CGSmartImage latest version path problem
Posted: Mon Feb 04, 2013 11:45 am
We've upgraded the CGSmartImage module to the latest version. Now we have path problem causing the not embedded images (noembed=1) not to show up. Since we mainly do photo-sites this is causing a big problem for us. When we look to the source code we see something 'funny'.
Our code (in a News summary template):
CGSmartImage outputs:
Note the directory "/uploads" is mentioned twice, causing the path to be wrong. We have not altered our code, we've only upgraded the CGSmartImage module...
We have other photo-sites on which we have not done the upgrade of the CGSmartImage module and there it outputs something like this:
Here we have no problem.
What, if so, are we doing wrong en what can we do about it?
Because of the 'random image feature' embedding is not an option for us.
Thanks in advance.
Ron Hoenson
HGPDESiGN
Our code (in a News summary template):
Code: Select all
{foreach from=$items item=entry name=foo}
{capture assign='category_page'}{$entry->category|replace:' ':'-'|lower}{/capture}
{assign var=loc value=$entry->file_location}
{assign var=img1 value=$entry->fields.image1->value}
{assign var=img2 value=$entry->fields.image2->value}
{assign var=img3 value=$entry->fields.image3->value}
{capture assign='num'}image{if $img3 !=''}{1|rand:3}{elseif $img2 !=''}{1|rand:2}{else}1{/if}{/capture}
{assign var=img value=$entry->fields.$num->value}
<div class="{if $smarty.foreach.foo.iteration % 4==0}sum_main_right{else}sum_main{/if}">
<a href="{$entry->link|regex_replace:'/returnid=[0-9]*/':"returnid=$category_page"}">
{CGSmartImage src="$loc/$img" filter_croptofit='225,140,tc' quality='100' noembed=1}
etc.
Code: Select all
<img src="http://ourdomain.nl/uploads/uploads/_CGSmartImage/IMG_2217-f33faa2fb22699bee5e5c99bde057d73.jpg" width="225" height="140" alt="IMG_2217-f33faa2fb22699bee5e5c99bde057d73.jpg"/>
We have other photo-sites on which we have not done the upgrade of the CGSmartImage module and there it outputs something like this:
Code: Select all
<img class="img-link" src="http://anotherdomain.nl/uploads/_CGSmartImage/IMG_1460-32610a890372c6b80821a00e6ec4f802.jpg" width="606" height="400" alt="IMG_1460-32610a890372c6b80821a00e6ec4f802.jpg"/>
What, if so, are we doing wrong en what can we do about it?
Because of the 'random image feature' embedding is not an option for us.
Thanks in advance.
Ron Hoenson
HGPDESiGN