Jump to content

[solved] How to remove Subcategories Header Image


Recommended Posts

Hello,

 

I would like to remove the wide header image from my subcategories, is this possible and if it is, how can I do this? I do want to keep the small subcategories images though.... So it's only the wide header image that I want removed.

 

Thanks in advance for any help!

Link to comment
Share on other sites

so if it is possible - please paste here contents of the category.tpl file located in your theme directory.

 

you can aslo try with this:

 

open the category.tpl file, you've got there (probably - because it's a non-default theme) something like:

 

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

 

you can remove it - or add comments, before code add {* and after the code add *}

Link to comment
Share on other sites

Ok, I got the category.tpl from my theme's folder, it looks like this:

 

{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
// <![CDATA[
   var imageShape = '{$image_shape}';
//]]>
</script>
{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}

		    {if (isset($show_cat_names) && $show_cat_names)}
			    <div class="category-title">
				    <h1>
						    {strip}
								    {$category->name|escape:'htmlall':'UTF-8'}
								    {if isset($categoryNameComplement)}
										    {$categoryNameComplement|escape:'htmlall':'UTF-8'}
								    {/if}
						    {/strip}
				    </h1>
			    </div>
		    {/if}

 {if $scenes || $category->id_image || $category->description}
 <div class="content_scene_cat">
  {if $scenes}
   <!-- Scenes -->
   {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
  {else}
   <!-- Category image -->
   {if $category->id_image}
 <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"/>
   {/if}
  {/if}

				    {if ($category->description && isset($show_cat_desc) && $show_cat_desc)}
   <div class="cat_desc">
							    <p>{$category->description}</p>
   </div>
  {/if}

 </div>
 {/if}

		    {if (isset($subcategories) && isset($show_subcategories) && $show_subcategories)}
 <!-- Subcategories -->
 <div id="subcategories">
  <h3>{l s='Subcategories'}</h3>
  <ul class="inline_list grid">
  {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|truncate:50:'...'}</p>
 {/if}
   </li>
  {/foreach}
  </ul>
  <br class="clear"/>
 </div>
 {/if}

 {if $products}
			    <div class="content_sortPagiBar">
				    <div class="sortPagiBar group">
					    {include file="./product-compare.tpl"}
					    {include file="./product-sort.tpl"}
					    {include file="./nbr-product-page.tpl"}
					    {include file="./product-view.tpl"}
				    </div>
			    </div>

			    <div id="category_view_type" class="{$category_view_type}">
				    <div id="category_image_type" class="{$image_shape}">
					    {include file="./product-list.tpl" products=$products}
				    </div>
			    </div>

			    {include file="./pagination.tpl"}

		    {else if $products == NULL}
			    {include file="./no-product.tpl"}
 {/if}

{elseif $category->id}
 <p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}

Link to comment
Share on other sites

remove or comment this:

 

   {if $category->id_image}
	 <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"/>
   {/if}

 

remember, that sometimes it's necessary to turn force compilation on (under the preferences > performance tab in BO), because without it - changes may not appear

  • Like 1
Link to comment
Share on other sites

  • 11 months later...

Does anyone know if this is available in 1.6 without changing the TPL files?  I've done a ton of programming in PrestaShop over the last two years, and I can appreciate the ability to leave the default theme as-is.  If it's not possible from a configuration standpoint, does anyone know why you'd ever want "No Image Available" or the "?" image?

Link to comment
Share on other sites

  • 3 months later...

ATTENTION:

 

There wouldn't be any use to modify your template files any longer. PrestaShop Team finally listened! Look, there's a button to toggle subcategories ON/OFF, and I mean, not the subcategories on your entire website but only the subcategories with the annoying "no image available" pictures that are listed right before your product listing! You'll still be able to see your subcategories from the category column and sort your products from those.

To disable or turn your subcategories off, simply go to PREFERENCES>>Themes>>Theme configurator. Alternatively, you can arrive at the same spot using MODULES>>Theme configurator>>Configure. On the Settings, you'll find "Display subcategories". Simply change it to NO. Or you can leave it at YES. (Check the attached image.)

 

post-748021-0-07803600-1411260027_thumb.jpg

 

It is worth mentioning to note that I just upgraded to 1.6.0.9. I don't know if this is a new feature or whether it had been there in all previous versions and we'd just been blind to it. One thing is certain; PrestaShop's subcategory is now what I'd call a FEATURE! Until now, it has been a stubborn and very annoying bug.

 
  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hello

Hope that some one sees my question. 

I have the same version of prestashop AND I have also checked NO to displaying subcategories, BUT I still see the Image not available on my subcategories pages. So it doesn't work for me. 

 

Can anyone tell me why? 

 

Best - Mette

Link to comment
Share on other sites

  • 8 months later...
  • 9 months later...

so if it is possible - please paste here contents of the category.tpl file located in your theme directory.

 

you can aslo try with this:

 

open the category.tpl file, you've got there (probably - because it's a non-default theme) something like:

 

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

you can remove it - or add comments, before code add {* and after the code add *}

 

 

 

Unable to display Subcategories images plz help me. i have been already uploaded images in Category thumbnail. Prestashop 1.6.1.4

 

post-1126972-0-83453700-1469162166_thumb.jpeg

Link to comment
Share on other sites

Hi,

 

I have a question about 

 

-> Category Cover Image

-> Category thumbnail

 

I tried to put image at Category thumbnail and when i go inside the category at front-end, the image for the subcategories are not showed.

But if I upload image at Category Cover Image it's showing at Category Cover Image and Category thumbnail

 

My question is: How can I show only the picture at Category thumbnail? Cause if I upload one image for Category thumbnail it's not showing  - Front-end "No image available"

 

Thanks

 

Marcelo

post-1292017-0-55633000-1469378669_thumb.png

post-1292017-0-55028100-1469378673_thumb.png

 

 

Link to comment
Share on other sites

  • 5 weeks later...

Hello,

I would like to remove all the subcategories blocks (text & images) in category page and remove the wide header image from my subcategories. I use the latest version 1.6.1.6, and use the default theme.

 

Thanks in advance.

Link to comment
Share on other sites

Thanks for your reply.

 

I did that and selected value NO and saved, but every time it automatically goes back to value YES.

I deleted/edited some code from my templete file before to remove the images from subcategeries blocks, so only display text in the blocks now.

 

Maybe me deleting/altering the template file before, the theme configurator option for hiding 'display subcategories' doesn't work anymore?

 

Thanks.

Link to comment
Share on other sites

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