Jump to content

Recommended Posts

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

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 2 months later...

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;
}

MrdSAMZ.png

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

 

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;
}

MrdSAMZ.png

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

  • 5 months later...

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