Jump to content

Subcategories as grid


Recommended Posts

Hello everyone,

 

i'm working on a site, i'm not so experienced so i'm asking the prestashop community.

I have many subcategories and they are in a list-view so it's pretty long before it you scroll down and find the products in the main category.

 

I want to have them next to eachother per two subcategories, now it's listed per one subcategory

How can I do this?

 

Also, I now have all the categories and subcategories under home, but I want to have one category that shows all maincategories.

 

How can I do those things above?

the site is www.studsgroothandel.nl

 

Hopefully it's understandable

 

 

Thanks in advance

Link to comment
Share on other sites



Hi

 

Add/Change this to your themes category.css file:

 

category.css line: 38

 


.inline_list li {

text-align: center;

float: left;

display: inline-block;

width: 96px;

height: 170px; /*changed*/

border: 1px dotted #ccc;

margin: 4px;

 

and this...

 

category.css line: 56

 


.inline_list li .cat_name {

font-weight: normal;

font-size: 14px; /*changed*/

text-transform: uppercase;

display: block;

margin-bottom: 5px;

font-family: 'Open Sans', 'Segoe WP', 'Segoe UI', Arial, Helvetica, sans-serif;

}


 

Should do it...

 

if you want them in two rows add this...

 

category.css line: 26

 


#subcategories {

margin-top: 15px;

clear: both;

display: block;

overflow: hidden;

width: 50%; /* added changed*/

}


 

NB.. as your site is responsive you will have to change these values dependant on screen size.

 

Nick



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

i think that just remove the float:left; from .inline_list li

if i were you i will also remove the dotted border:

remove border: 1px dotted #ccc; from .inline_list li

 

and just add height:50px; param to:

.inline_list li .cat_name

 

effect:

FObVOBd.png

  • Like 1
Link to comment
Share on other sites

i think that just remove the float:left; from .inline_list li

if i were you i will also remove the dotted border:

remove border: 1px dotted #ccc; from .inline_list li

 

and just add height:50px; param to:

.inline_list li .cat_name

 

effect:

FObVOBd.png

Hello,

 

First, thank you alot for helping, also others.

 

As above it would look great. I just made the changes as you suggest.

It improved, but it only shows half of the subcategories name.

Link to comment
Share on other sites

 

Hi

 

This bit of CSS should reveal the text:

 

category.css line: 38
 
.inline_list li {
text-align: center;
float: left;
display: inline-block;
width: 96px;
height: 170px; /*changed*/
border: 1px dotted #ccc;
margin: 4px;
 
Nick

 

 

Perfect! Thanks alot, it's fixed now.

Thanks to you guys the result became nicer then I had in mind.

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