Jump to content

[SOLVED] Hide or remove Subcategories image and link in custom theme


wester17

Recommended Posts

Hello! i was searching about that question on the forum, but i understud that i need to show up some things here to get help.

 

So this is  my category.tpl content:

 

{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
<span class="category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</span>
{/strip}
</h1>
{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
{*
{else}
<!-- Category image -->
{if $category->id_image}
<div class="align_center">
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
</div>
{/if}
*}
{/if}
        {if $category->description}
{if strlen($category->description) > 120}
<p class="cat_desc bordercolor bgcolor" id="category_description_short">{$category->description|truncate:120} <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a></p>
<p class="cat_desc bordercolor bgcolor" id="category_description_full" style="display:none">{$category->description}</p>
{else}
<p class="cat_desc bordercolor bgcolor">{$category->description}</p>
{/if}
            {/if}
{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h2>{l s='Subcategories'}</h2>
<ul>
{foreach from=$subcategories item=subcategory}
<li>
<a class="bgcolor bordercolor" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" />
{/if}
<span>{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:20:'...'}</span>
</a>
                    <strong></strong>
</li>
{/foreach}
</ul>
</div>
        <div class="clear"></div>
{/if}
{if $products}
{include file="$tpl_dir./product-sort.tpl"}
{include file="$tpl_dir./product-list.tpl" products=$products}
{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}
{elseif !isset($subcategories)}
<p class="warning">{l s='There are no products in this category.'}</p>
{/if}
{elseif $category->id}
<p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}
 
 
 
Thank you all anyway for reading this)
Edited by vekia (see edit history)
Link to comment
Share on other sites

ti hude subcategories images, you have to remove this code:
 


<a class="bgcolor bordercolor" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" />
{/if}
<span>{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:20:'...'}</span>
</a>

instead of this code, use just simple:

<span>{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:20:'...'}</span>

to display category name without link.

  • Like 1
Link to comment
Share on other sites

what you exactly want to achieve? simple list of categories?

now it's time to customize css styles:

#subcategories ul li {
float: left;
margin: 20px 20px 0 0;
height: 196px;
border: 1px solid #e5e5e5;
position: relative;
}

everything depends on what you exactly expect.

Link to comment
Share on other sites

Sorry for late replys! to much things to do...and for broken link too

 

Again; thank you for patience and help.. and Merry Christmas to all!)

 

The thing i want to achieve: i want to hide this list of subcategories from category list - another words if i choose some category or

subcat from the main menu  - you get there and first of what you see instead of products  is this long and useless list of subcats - i mean if i already chosen

some category i dont want to see them again, furthermore - if i got my main menu block then there is no point in duplication.

Link to comment
Share on other sites

to remove subcategories at all, remove this code:
 

{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h2>{l s='Subcategories'}</h2>
<ul>
{foreach from=$subcategories item=subcategory}
<li>
<a class="bgcolor bordercolor" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" />
{/if}
<span>{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:20:'...'}</span>
</a>
                    <strong></strong>
</li>
{/foreach}
</ul>
</div>
        <div class="clear"></div>
{/if}
Link to comment
Share on other sites

  • 1 year 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...