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

One category Image per row

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-03-2016, 04:39 PM
 
rowdybunny rowdybunny is offline
 

Advanced Member
  
Join Date: Aug 2014
Posts: 67
 

Default One category Image per row

On the home page where the category images are displayed I would like to use wide images and have one category image displayed on each row that will take up the area that the three category images now take up. I currently have 4 categories setup. I have change my category image to 800 x 300 and I am running into a few problems.

First it is still displaying in a row of three categories so on the first row my first three category images are overlapping. The second row is displaying as I would like it to (because of course there is only one category in that row). How to I change this so only one category/image is displayed per row.

Next it seems that changing the category image size to 800 x 300 is preventing it from being responsive. My original image size is 800 x 300 which is why I change it to that image size, but as the screen size gets smaller the image does not. What can I set this to to have my 800 x 300 image resize to a smaller size as the screen size gets smaller.
__________________
X-Cart 5.2 & 5.3.3.3
Reply With Quote
  #2  
Old 04-03-2016, 10:33 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: One category Image per row

Try the following CSS code:
Code:
.subcategory-icon img { width: 800px; max-width: 100%; height: auto; } body ul.subcategory-view-icons.subcategory-list.grid-list > li { float: none; width: auto; display: block; }

You can add it on the "Look & Feel" -> "Custom CSS" tab, but the better way is wrapping this up into a custom module:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 04-04-2016, 09:56 AM
 
rowdybunny rowdybunny is offline
 

Advanced Member
  
Join Date: Aug 2014
Posts: 67
 

Default Re: One category Image per row

Thanks for the response. I've had some trouble creating custom modules. I have been working with x-cart a little under a year and so far none of the ones I have tried have worked. So I went with custom CSS.

I now have one category image per row, but the image is still not the correct size, which is kind of strange as yesterday when I was working with this they were the correct size, just overlapping three per row.

After I made my post last night in the Look and Feel section I changed my Category Image sizes back to a width of 250 and had intended to change it back to 800 once I got an answer here.

After I read your reply I changed the image size back to 800 in the Look & Feel section and then updated the custom CSS. Images were still 250px. I cleared the Aggregation cache as well as my browser cache, I even redeployed the store. I deleted the category images (renamed them on my end) and uploaded them again. And they are still 250px.

I updated the CSS as follows and still not working:

Code:
.subcategory-icon img { width: 800px; !important; max-width: 100%; !important; height: auto; !important; }

If I remove the above style from the style sheet, I am back to 800px and they are one per row as I want them, but then I run into the problem that they are not responsive.

https://www.phiniac-glass.com/
__________________
X-Cart 5.2 & 5.3.3.3
Reply With Quote
  #4  
Old 04-04-2016, 12:00 PM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: One category Image per row

Add this to your custom CSS
Code:
ul.grid-list a span { margin: 0 auto; width: 100%; }
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
Reply With Quote
  #5  
Old 04-04-2016, 12:03 PM
 
rowdybunny rowdybunny is offline
 

Advanced Member
  
Join Date: Aug 2014
Posts: 67
 

Default Re: One category Image per row

Thanks a bunch! That did the trick!
__________________
X-Cart 5.2 & 5.3.3.3
Reply With Quote
  #6  
Old 04-04-2016, 12:06 PM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: One category Image per row

Great to know I was able to help
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
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 02:02 AM.

   

 
X-Cart forums © 2001-2020