Jump to content

[SOLVED]image link and URL rewriting


SylRob

Recommended Posts

Hi,

 

I have a strange problem.

 

The images I call through my code are display when my url are not rewrite (disable in the backoffice) and don't display when the url rewriting is on

 

here is my code (with smarty, in product-list.tpl) :

 

{assign var=imageIds value="`$product.id_product`-`$image[0].id_image`"}
   <img class="hidden imageAttribut_{$image[0].id_attribute}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'home_default')}" alt="{$image[0].legend|htmlspecialchars}" />

 

here what give {$link->getImageLink(...) without url rewriting :

 

http://www.monsite.c...ome_default.jpg

 

with this, I have my image

 

but when I enable the url rewriting :

 

http://www.monsite.c...me_default/.jpg

 

obviously it doesn't work.

 

someone have an idea where it could come from ?

 

for the record :

- The Image I want to display are not the default image normaly displayed in product-list, this one appear normaly.

- $imageIds give me the expected string like "8-37"

- If I put the name of my product at the end of the rewrote URL the image is displayed (http://www.monsite.c..._my_product.jpg)

Edited by SylRob (see edit history)
Link to comment
Share on other sites

I have the answer:

 

the problem was coming from $product->link_rewrite

 

I should have wrote $product.link_rewrite because this is how it is called in product-list.tpl

 

The object $product come from the product page controller

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...