Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Thumbnail size in xc5

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-29-2014, 05:31 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default Thumbnail size in xc5

Is there a setting for the thumbnail size? As the thumbnail images are generated I would like to make mine slightly larger, maybe 180px or 200px.
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #2  
Old 06-02-2014, 03:48 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Thumbnail size in xc5

Hi Richard!

These values are hard-coded. However, you can easily define new values by creating a decoration of the XLite/View/ProductBox class in your module.

You should override the following method in this class:
PHP Code:
protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams += array(
            
self::PARAM_PRODUCT_ID => new \XLite\Model\WidgetParam\ObjectId\Product('Product Id'0true),
            
self::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int(
                
'Maximal icon width'160true
            
),
            
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                
'Maximal icon height'160true
            
),
        );
    } 

Quote:
Originally Posted by RichieRich
Is there a setting for the thumbnail size? As the thumbnail images are generated I would like to make mine slightly larger, maybe 180px or 200px.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #3  
Old 06-03-2014, 08:00 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default Re: Thumbnail size in xc5

Is this likely to become a standard setting do you think? It is in x-cart 4. Also, is there any reason the image quality is reduced in the thumbnail generation so much? I understand the performance/ load time of higher image, but what if you only had 5 high-end products. It appears about 70% reduction in quality for thumbnails.

Also, there could be 2 thumbnails generated, with one displayed to standard screen and one to retina display screens.
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #4  
Old 06-03-2014, 02:00 PM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Thumbnail size in xc5

We are thinking of it, but not sure yet.

Generally the size of thumbnail is dictated by the theme, so the size of thumbnails is the option of a theme, not the entire store. X-Cart 4 has such settings, but most of 3rd party skins disregard them.

As for thumbnail quality, there are two sides of the coin, some merchants want lower quality, small images, some want high quality and do not care about size. That is why we implemented it in a way to cover the general majority of users (as we felt) and now are getting feedback about what is good and what can be improved. At this point, you can easily apply the mod, so your thumbnails would not be that much resized + you can register an idea about high quality thumbnails.

As for retina images, I believe, it should implemented as a mod and X-Cart allows to define you two images for a single thumbnail in order to server retina needs.

Quote:
Originally Posted by RichieRich
Is this likely to become a standard setting do you think? It is in x-cart 4. Also, is there any reason the image quality is reduced in the thumbnail generation so much? I understand the performance/ load time of higher image, but what if you only had 5 high-end products. It appears about 70% reduction in quality for thumbnails.

Also, there could be 2 thumbnails generated, with one displayed to standard screen and one to retina display screens.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 06-03-2014, 04:54 PM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default Re: Thumbnail size in xc5

Quote:
Originally Posted by tony_sologubov
We are thinking of it, but not sure yet.

Generally the size of thumbnail is dictated by the theme, so the size of thumbnails is the option of a theme, not the entire store. X-Cart 4 has such settings, but most of 3rd party skins disregard them.


I think there is space for a larger thumbnail without breaking the theme. And it could be allowed up to a maximum of the space that is allowed, or even if you have a bigger thumbnail, it will squeeze into the size of the theme in this new repsonsive templates which dont allow images to go outside the containers.
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #6  
Old 06-04-2014, 03:32 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Thumbnail size in xc5

That is true if we are talking about default theme. But most of 3rd party themes just force the exact thumbnail size. They do not want to support several thumbnail sizes.

So, there will be a setting an admin area and merchants would think that it affects the display, but if they install 3rd party theme, this setting suddenly stops working. We do not want this effect.

Quote:
Originally Posted by RichieRich
I think there is space for a larger thumbnail without breaking the theme. And it could be allowed up to a maximum of the space that is allowed, or even if you have a bigger thumbnail, it will squeeze into the size of the theme in this new repsonsive templates which dont allow images to go outside the containers.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #7  
Old 06-04-2014, 03:45 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default Re: Thumbnail size in xc5

Dont most people use default responsive theme? Is there a way you can make a setting if the customer is using the default responsive theme for the majority?
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #8  
Old 06-25-2014, 01:41 PM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Thumbnail size in xc5

Hi Richard!

Sorry for being silent for a while. We have been to IRCE. Now I am back from the trip and catching up with all the work.

I am not sure, but I feel that majority of people tend to use a custom theme. Anyways, if you feel that this setting is a must, please post an idea here:
http://ideas.x-cart.com/forums/229428-x-cart-5-ideas

We want to implement features that are needed for merchants/developers, so your voice would be highly appreciated.

Finally, if you need to change the thumbnail sizes in your own store, I can show you the approach as a part of dev docs. Now I am working on complete guide for theme creation, so I will describe this process there.

UPDATE: oops, I already explained it earlier in this thread: http://forum.x-cart.com/showpost.php?p=373839&postcount=2

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!

Last edited by tony_sologubov : 06-25-2014 at 01:43 PM.
Reply With Quote
  #9  
Old 10-31-2014, 02:49 PM
 
spdesign spdesign is offline
 

Advanced Member
  
Join Date: Mar 2010
Posts: 31
 

Default Re: Thumbnail size in xc5

I have been trying to change the size of the category icons. Am I correct that the procedure is to create

/XLite/modules/MyName/MyThemeName/View/Subcategories.php

which has the code

Code:
namespace XLite\Module\MyName\MyThemeName\View; class Subcategories extends \XLite\View\Subcategories implements \XLite\Base\IDecorator { protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array( self::PARAM_DISPLAY_MODE => new \XLite\Model\WidgetParam\Set( 'Display mode', $this->getDisplayMode(), true, $this->displayModes ), self::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int( 'Maximal icon width', 200, true ), self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int( 'Maximal icon height', 200, true ), ); } }

to change icon size to 200px? It doesn't seem to work for me. Icons remain at 160px.
__________________
===========
x-cart gold/classic
4.6.4
Reply With Quote
  #10  
Old 11-03-2014, 04:03 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Thumbnail size in xc5

It should've worked out. Could you please send your whole module, so I could check?

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:46 AM.

   

 
X-Cart forums © 2001-2020