Sub category columns

Currently our sub categories are listed in 2 columns.



Is there a way to adjust it to 3 or 4 columns without altering the code? I looked through admin but can't find anywhere that would allow me to do it.



Currently were on v3.04.





Chris

Chris,

in your admin go into Settings///Appearance and you can change the default amount of columns shown in categories and subcategories.



Also if you go into a specific category in Admin you can click on the layout tab and specify the amount of columns for that particular category.



John

[quote name='JohnCarroll' timestamp='1361571207' post='156206']

Chris,

in your admin go into Settings///Appearance and you can change the default amount of columns shown in categories and subcategories.



Also if you go into a specific category in Admin you can click on the layout tab and specify the amount of columns for that particular category.



John

[/quote]



Thanks John, but I was looking to have 3 to 4 columns of sub category names. For example:





xxxx xxxxx xxxx xxxxx < Sub category section columns

xxxx xxxxx xxxx xxxxx



-----------------------------------------------



Product Product Product Product < Product Columns



The settings that I see in the admin change the product columns, but not the sub category columns.







Chris













Chris

See this KB article: Category Multi Column List



You can use this if you want to set your subcategories to be displayed as images, and set the number of columns too. Seems stupid not to have this included in Settings>Appearance since the functionality is already there for setting the number of columns in a product list, but nevermind…



Otherwise, if you want to remain with text links:



Enable the My Changes addon if it is not already enabled.



Create the following file:

/skins/your_skin/customer/addons/my_changes/hooks/categories/view.override.tpl



Use the following code:

```php


{if $subcategories or $category_data.description || $category_data.main_pair}
{math equation="ceil(n/c)" assign="rows" n=$subcategories|count c=$columns|default:"4"}
{split data=$subcategories size=$rows assign="splitted_subcategories"}
{if $category_data.description && $category_data.description != ""}
{$category_data.description|unescape}

{/if}


{if $category_data.main_pair}

{include file="common_templates/image.tpl" show_detailed_link=true images=$category_data.main_pair object_type="detailed_category" no_ids=true rel="category_image" show_thumbnail="Y" image_width=$settings.Thumbnails.category_details_thumbnail_width image_height=$settings.Thumbnails.category_details_thumbnail_height hide_if_no_image=true}

{if $category_data.main_pair.detailed_id}
{include file="common_templates/previewer.tpl" rel="category_image"}
{/if}
{/if}
{if $subcategories}

{if $subcategories|@count < 6}

    {/if}
    {foreach from=$splitted_subcategories item="ssubcateg"}
    {if $subcategories|count >= 6}


      {/if}
      {foreach from=$ssubcateg item=category name="ssubcateg"}
      {if $category.category_id}
    • {$category.category}
    • {/if}
      {/foreach}
      {if $subcategories|count >= 6}


    {/if}
    {/foreach}
    {if $subcategories|count < 6}

{/if}

{/if}

{/if}
{if $smarty.request.advanced_filter}
{include file="views/products/components/product_filters_advanced_form.tpl" separate_form=true}
{/if}
{if $products}
{assign var="layouts" value=""|fn_get_products_views:false:0}
{if $category_data.product_columns}
{assign var="product_columns" value=$category_data.product_columns}
{else}
{assign var="product_columns" value=$settings.Appearance.columns_in_products_list}
{/if}
{if $layouts.$selected_layout.template}
{include file="`$layouts.$selected_layout.template`" columns=`$product_columns`}
{/if}
{elseif !$subcategories}

{$lang.text_no_products}


{/if}

{capture name="mainbox_title"}{$category_data.category}{/capture}
```