Jump to content

[SOLVED] Sub Categories Image removal


AllyM

Recommended Posts

Hi,

 

Could anyone help me please, i've racked this forum for ages trying to find a solution but to no avail.

 

I'm trying to remove the images and links in the sub categories (see attached screenshot)

 

I have looked at the various threads about amending the category.tpl in themes. However nothing seems to remove these images. My category.tpl now looks like this.

 

 

{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'}

<span>

{if $category->id == 1 OR $nb_products == 0}{l s='There are no products.'}

{else}

{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 

{$nb_products} 

{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}

{/if}

</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_2">

<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" 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 $products}

{include file="$tpl_dir./product-compare.tpl"}

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

 

Am I on the right path here? I have no more hair left :-)

 

Many thanks for help

Ally

post-283809-0-86936900-1337185786_thumb.png

Link to comment
Share on other sites

Did you go to the products catalog and edit the product and delete the images from the images tab.

It looks as though you deleted the images from the img folder but did not delete from the images tab.

 

 

 

Link to comment
Share on other sites

I deleted the images from the img folder and not from the tab as you suggested. When I add a new image to the image tab and then delete it it still shows the red cross. - Is there a way around this?

Link to comment
Share on other sites

When you go to the image tab is there an image placeholder showing as in the pic below.

Deleting the images from the img folder is a bad idea as it still leaves the info in the database.

You could also try to remove the sub-category and then add the sub-category back.

If you can not figure this out send me log-in details for your BO in a PM and I will have a look.

 

You may also be able to fix this by editing the database directly.

 

 

 

Link to comment
Share on other sites

Yes, there is an image placeholder - The problem with removing the subcategories and adding back in is that I have a lot of subcategories with product images and I don't fancy having to do all that donkey work again. I'll send you a pm with my log in details and if you are able to remove the sub category images and hyperlinks I'd be very grateful.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

yes please post it im haveing this problem too - i need to figure out how to remove the pictures, links and "subcategory text on my site. ive tried the solutions on about 4 other posts but nothing seems to work, i think im missing something because even if i wipe my whole file (category.tpl) it doesnt change anything! Im pulling my hair out trying to get it to work! If anyone could help it would be much appreciated:D this is my current code

 

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

<div class="vp_boxstyle clearfix">

{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')}" 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}

<div class="cat_desc">{$category->description}</div>

{/if}

</div>

 

{if isset($subcategories)}

<!-- Subcategories -->

<div id="subcategories">

<h3>{l s='Subcategories'}</h3>

<ul class="inline_list">

{foreach from=$subcategories item=subcategory}

<li>

<a 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')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{else}

<img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{/if}

 

 

 

 

 

 

 

 

</a><br />

<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>

</li>

{/foreach}

</ul>

<br class="clear"/>

</div>

{/if}

 

{if $products}

{include file="$tpl_dir./product-compare.tpl"}

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

 

 

I changed it back after ever edit attempt so it still unedited

Link to comment
Share on other sites

Sorry guy's I should have posted this as it is very simple, find the section <!--Subcategories--> and modify as below.

You are going to add style="display:none" to the <div id="subcategories"> line 62.

Be sure to turn force compile on and cache off after editing the tpl file.

Please let me know how it goes.

 

Change this

 

<!-- Subcategories -->

<div id="subcategories">

<h3>{l s='Subcategories'}</h3>

<ul class="inline_list">

{foreach from=$subcategories item=subcategory}

 

To This

<!-- Subcategories -->

<div id="subcategories" style="display:none">

<h3>{l s='Subcategories'}</h3>

<ul class="inline_list">

{foreach from=$subcategories item=subcategory}

Edited by tdr170 (see edit history)
  • Like 2
Link to comment
Share on other sites

this should remove the category images on the center column

 

I got it ok save you stuff incase this doesnt work it did for me...anyways the MAIN thing i had to do to get it to work was go to preferences>proformance in your back end and switch force compile to yes and cache to no-make sure you switch these back -once that is done remove

 

{if isset($subcategories)}

<!-- Subcategories -->

<div id="subcategories">

<h3>{l s='Subcategories'}</h3>

<ul class="inline_list">

{foreach from=$subcategories item=subcategory}

<li>

<a 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')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{else}

<img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{/if}

 

in the file category.tpl once that is all done save the file clear you browser history and check your site. hope that help if not let me know an il try and help you out- also dont forget to set you back end setting back :)

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

this should remove the category images on the center column

 

I got it ok save you stuff incase this doesnt work it did for me...anyways the MAIN thing i had to do to get it to work was go to preferences>proformance in your back end and switch force compile to yes and cache to no-make sure you switch these back -once that is done remove

 

{if isset($subcategories)}

<!-- Subcategories -->

<div id="subcategories">

<h3>{l s='Subcategories'}</h3>

<ul class="inline_list">

{foreach from=$subcategories item=subcategory}

<li>

<a 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')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{else}

<img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{/if}

 

in the file category.tpl once that is all done save the file clear you browser history and check your site. hope that help if not let me know an il try and help you out- also dont forget to set you back end setting back :)

 

 

There is no need to remove all this code just add the style="display:none" as in my post above and if you ever decide to use the sub images just remove.

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

  • 3 months later...
  • 3 years later...

tdr170 im having the same problem, i don't want to display the subcategories pictures.

In Category.tpl i tried to write <div id="subcategories" style="display:none"> instead of <div id="subcategories">. But this made all my Subcategories disappear, and all i wanted was just the subcategorie pictures to me removed instead. Can anyone help?

Link to comment
Share on other sites

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