[email protected] Posted July 29, 2013 Share Posted July 29, 2013 A client wanted to the sub categories and categories list to be in grid view and not in a list so i used the following code and placed it in the categories.css in the theme .inline_list li { border-bottom: 1px dotted #CCCCCC; float: left; height: 85px; padding: 10px 0; width: 178px; } .inline_list li .img { float: left; margin: 0 56px; } .inline_list li .cat_name { float: left; font-weight: bold; text-align: center; width: 178px; } I then removed the descriptions in the category.tpl so the list only showed the category image and name. removing <p class="cat_desc">{$subcategory.description}</p> From this: <!-- Subcategories --> <div id="subcategories"> <ul class="inline_list"> {foreach from=$subcategories item=subcategory} <li class="clearfix"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> {if $subcategory.description} <p class="cat_desc">{$subcategory.description}</p> {/if} </li> {/foreach} </ul> <br class="clear"/> </div> to: <!-- Subcategories --> <div id="subcategories"> <ul class="inline_list"> {foreach from=$subcategories item=subcategory} <li class="clearfix"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> {if $subcategory.description} {/if} </li> {/foreach} </ul> <br class="clear"/> </div> this worked for me on a non-default theme and using prestashop version 1.5.4.1 i hope this is of some help to someone 3 Link to comment Share on other sites More sharing options...
sumo23 Posted August 17, 2013 Share Posted August 17, 2013 (edited) Hi. Thanks for a tip. It works very nice for me. I've made some modifications to have a 4 subcategories in line. But how can I move down grey background and comparision and sorting modules? http://easycaptures.com/fs/uploaded/729/1679410282.jpg Edited August 17, 2013 by sumo23 (see edit history) Link to comment Share on other sites More sharing options...
thai.fast Posted September 14, 2013 Share Posted September 14, 2013 How about the product list in grid? Link to comment Share on other sites More sharing options...
vekia Posted September 14, 2013 Share Posted September 14, 2013 product grid view prestashop: product grid prestashop modification Link to comment Share on other sites More sharing options...
brko Posted November 17, 2013 Share Posted November 17, 2013 Hi. Thanks for a tip. It works very nice for me. I've made some modifications to have a 4 subcategories in line. But how can I move down grey background and comparision and sorting modules? http://easycaptures.com/fs/uploaded/729/1679410282.jpg Hi, can you please tell me what madifications have you made to have 4 categories in line? or more? thanks Link to comment Share on other sites More sharing options...
vekia Posted November 17, 2013 Share Posted November 17, 2013 Hi, can you please tell me what madifications have you made to have 4 categories in line? or more? thanks can you please share url to your website? i will check it and then - give you solution Link to comment Share on other sites More sharing options...
brko Posted November 17, 2013 Share Posted November 17, 2013 can you please share url to your website? i will check it and then - give you solution http://bivakshop.sk/ps/index.php?id_category=14&controller=category Link to comment Share on other sites More sharing options...
vekia Posted November 17, 2013 Share Posted November 17, 2013 in file: http://bivakshop.sk/ps/themes/default/css/category.css line: 49 change width param from 178px; to 128px; .inline_list li { border-bottom: 1px dotted #CCCCCC; float: left; height: 85px; padding: 10px 0; width: 128px; } in the same file in line 45 change .inline_list { list-style-type: none; margin-top: 10px; } effect to: .inline_list { list-style-type: none; margin-top: 10px; clear: both; display: block; overflow: hidden; } Link to comment Share on other sites More sharing options...
brko Posted November 17, 2013 Share Posted November 17, 2013 in file: http://bivakshop.sk/ps/themes/default/css/category.css line: 49 change width param from 178px; to 128px; .inline_list li { border-bottom: 1px dotted #CCCCCC; float: left; height: 85px; padding: 10px 0; width: 128px; } in the same file in line 45 change .inline_list { list-style-type: none; margin-top: 10px; } effect to: .inline_list { list-style-type: none; margin-top: 10px; clear: both; display: block; overflow: hidden; } Thank you very muchchchc Link to comment Share on other sites More sharing options...
sumo23 Posted November 18, 2013 Share Posted November 18, 2013 Thanks to all. I solved my problem using tutorial http://mypresta.eu/en/art/developer/prestashop-subcategories-grid.html Link to comment Share on other sites More sharing options...
vekia Posted November 18, 2013 Share Posted November 18, 2013 you're welcome glad to hear that i could help you in this case if you've got any questions related to subcategories list as grid - feel free to continue discussion with regards, Milos Link to comment Share on other sites More sharing options...
JulesLambda Posted April 30, 2014 Share Posted April 30, 2014 Hey everyone !I just followed the tutorial but it doesn't work for me.I've got the grid, but the text and images are not center.There is a link of the site : http://telandtab.com/index.php?id_category=6&controller=categoryI'm on prestashop 1.5.6.Thanks you ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now