Jump to content

Adding a new image type


Recommended Posts

Hi all

 

I added a new image type (in Back Office > Preferences > Images) with width=125 and height=105

 

I want this to be the image type for the new products block. The code in blocknewproducts.tpl was:

 

<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}"
height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" />

 

I replaced 'medium' with my new type which i called 'recent'

 

But then, what about the variables $mediumSize.height and $mediumSize.width? What should they become?

I tried $recentSize.... but it didnt work

 

Thanx!

Link to comment
Share on other sites

  • 1 month later...

Ok, go to controllers/ProductController.php the same in controllers/CategoryController.php

 

Search:

'homeSize' => Image::getSize('home'),

 

Add:

'homeSize' => Image::getSize('home'),

'recentSize' => Image::getSize('recent'),

 

Go modules/homefeatured/homefeatured.php

 

Search:

$smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home')));

 

Replace:

$smarty->assign(array('products' => $products, 'recentSize' => Image::getSize('recent')));

 

 

 

"recent is you image name"

 

Best Regards

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...