Jump to content

Recommended Posts

Hi Everyone, Thanks in advance for your help.

 

I dont want the subcategory image displayed when the customer clicks into the subcategory product page. 

 

I read on the forum a previous post which suggested the below:

 

Change lines 20-24 of category.tpl (in PrestaShop v1.3.5) from:

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

to:

{*{else} <!-- Category image --> {if $category->id_image} <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" /> {/if}*}

 

 

However I for the life of me I cant get it to work, and i cant work out if im either doing it wrong or this advice is simply out of date. Im using PrestaShop™ 1.5.6.2

 

This problem is really frustrating me and would really appreciate any advice or if anyone is having the same problem.

 

Kind Regards

 
Link to comment
Share on other sites

Hi, 

can you post the link of your shop??

 

I don't know if category.tpl of Prestashop 1.6 is the same of 1.5... However,  you can try to find in this file the line 48 and if like this:

 

<div class="content_scene_cat_bg" {if $category->id_image}style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) 0 top no-repeat; background-size:contain; min-height:{$categorySize.height}px;" {/if}>

 

You can delete the red part.

  • Like 1
Link to comment
Share on other sites

Hi Thanks for your help.

 

I cant see that text at all. My full text for category.tpl with  PrestaShop™ 1.5.6.2. reads:

 

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

{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}
            {/strip}
        </h1>
        
        
        {if $scenes || $category->description || $category->id_image}
        <div class="content_scene_cat">
            {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')|escape:'html'}" 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">
                    <p id="category_description_short">{$category->description}</p>
                </div>
            {/if}
        </div>
        {/if}
        {if isset($subcategories)}
        <!-- Subcategories -->
        <div id="subcategories" class="products_block">
            <h3>{l s='Subcategories'}</h3>
            <!-- Megnor start -->
            {assign var='sliderFor' value=24} <!-- Define Number of product for SLIDER -->
            {assign var='subCatCount' value=count($subcategories)}
            {if $subCatCount >= $sliderFor}
            <div class="customNavigation">
                <a class="btn prev"> </a>
                <a class="btn next"> </a>
            </div>
            {/if}
            <!-- Megnor End -->
            <ul id="{if $subCatCount >= $sliderFor}subcategory-carousel{elseif {count($subcategories)} == 2}subcategory2-grid{else}subcategory-grid{/if}" class="{if $subCatCount >= $sliderFor}product-carousel{else}subcategory_list{/if} ">
            {foreach from=$subcategories item=subcategory}
                <li class="{if $subCatCount >= $sliderFor}slider-item{else}subcat-{$subCatCount}{/if}">
                <div class="inline_list">
                    <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')|escape:'html'}" 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:30}</p>
                    {/if}
                    </div>
                </li>
            {/foreach}
            </ul>
            <br class="clear"/>
        </div>
        <span class="subcategory_default_width" style="display:none; visibility:hidden"></span>
        {/if}

        <!--<div class="resumecat category-product-count">-->
        {include file="$tpl_dir./category-count.tpl"}
        <!--</div>-->

        {if $products}
            <div class="content_sortPagiBar">
                <div class="sortPagiBar">
                    {include file="./product-sort.tpl"}
                    {include file="./nbr-product-page.tpl"}
                </div>
                
            </div>
            <div class="product_main_ul">
            {include file="./product-list.tpl" products=$products}
            </div>
            <div class="content_sortPagiBar">
                <div class="sortPagiBar_bottom">
                    {include file="./product-compare.tpl" paginationId='bottom'}
                    {include file="$tpl_dir./pagination.tpl" paginationId='bottom'}
                </div>
            </div>
            
        {/if}
        
    {elseif $category->id}
        <p class="warning">{l s='This category is currently unavailable.'}</p>
    {/if}
{/if}

 

 

Thoughts?
 

Kind Regards

Kieran

Link to comment
Share on other sites

Oooooh :D

I'm a kid, I like toys!!! xD

 

So...

 

  <!-- Megnor End -->
            <ul id="{if $subCatCount >= $sliderFor}subcategory-carousel{elseif {count($subcategories)} == 2}subcategory2-grid{else}subcategory-grid{/if}" class="{if $subCatCount >= $sliderFor}product-carousel{else}subcategory_list{/if} ">
            {foreach from=$subcategories item=subcategory}
                <li class="{if $subCatCount >= $sliderFor}slider-item{else}subcat-{$subCatCount}{/if}">
                <div class="inline_list">
                    <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')|escape:'html'}" 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:30}</p>
                    {/if}
                    </div>

 

Delete the red part.

Remember, do a backup!!

Empty cache!!!!!! Otherwise you'll not see the changes immediately!

  • Like 1
Link to comment
Share on other sites

Hi

 

Thanks so much for your advice! :)

 

Did it and it took away the subcategory button thumbnail image away (i still want this) and then when you click in it still shows the category image on the product page which is the one i want to remove.

 

I'll keep the file as it is if you wana have to look at, then load the original file back up.

 

Any ideas how to change the original to not show the category image in product page but still retain the category image on the thumbnail before you click in?

 

Kind Regards

Link to comment
Share on other sites

Oh so sorry, I've done delete the subcategory img...

You want delete the category img...

 

Put the red part in the same poisition and delete this:

 

  {if $scenes || $category->description || $category->id_image}
        <div class="content_scene_cat">
            {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')|escape:'html'}" 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}

 

Sorry for mistaken!!!

  • Like 1
Link to comment
Share on other sites

Thanks so much! Worked a treat! Your a legend! :D

 

I deleted all the blue but then the webpage didnt work. So just applied the same first instructions to the category image part and it worked a treat!

 

Just for any future readers with the same issue, i deleted in red bits below.

 

{if $scenes || $category->description || $category->id_image}
        <div class="content_scene_cat">
            {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')|escape:'html'}" 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}

 

 

 

To see the final result click the link to our hen party accessories

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hey guys

 

Can someone help me please.

 

 I want to know if I can add HTML content in the area <div class = " content_scene_cat "> where the category text or image is displayed.
 
I would like to have different HTML content for each category presented here. Is this possible?
Link to comment
Share on other sites

Hi guys.

Have done it on Prestashop 1.6

Have chenged category.tpl from:

 

<!-- Category image -->
                   <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>

to: 

 

<!-- Category image -->
                   {* <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div> *}
                  {/if}
            </div>
 
I have commented that code.
  • Like 1
Link to comment
Share on other sites

 

Hi guys.

Have done it on Prestashop 1.6

Have chenged category.tpl from:

 

<!-- Category image -->
                   <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>

to: 

 

<!-- Category image -->
                   {* <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div> *}
                  {/if}
            </div>
 
I have commented that code.

 

 

It works fine, but i would like to just remove the picture not the text description, and i dont know what code to remove.

Link to comment
Share on other sites

With a little help from a friend i got the text and background back with this code

Its still the category.tpl for PS 1.6 im working with.

<!-- Category image -->
                    <div class="content_scene_cat_bg" style="background-size:cover; min-height:{$categorySize.height}px;">
						{if $category->description}
							<div class="cat_desc">
							<span class="category-name">
								{strip}
									{$category->name|escape:'html':'UTF-8'}
									{if isset($categoryNameComplement)}
										{$categoryNameComplement|escape:'html':'UTF-8'}
									{/if}
								{/strip}
							</span>
							{if Tools::strlen($category->description) > 350}
								<div id="category_description_short" class="rte">{$description_short}</div>
								<div id="category_description_full" class="unvisible rte">{$category->description}</div>
								<a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
							{else}
								<div class="rte">{$category->description}</div>
							{/if}
							</div>
						{/if}
					</div>

The problem now is that the background is one size and it does not auto fit with the text as it normally do, does anyone know how to fix it ?

 

I have added a picture to show how it looks now with the code from above.

post-829188-0-36228300-1412941303_thumb.jpg

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

  • 8 months later...
{*

* 2007-2015 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:


* 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-2015 PrestaShop SA

*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)

*  International Registered Trademark & Property of PrestaShop SA

*}

{include file="$tpl_dir./errors.tpl"}

{if isset($category)}

{if $category->id AND $category->active}

    {if $scenes || $category->description || $category->id_image}

<div class="content_scene_cat">

            {if $scenes}

                  <div class="content_scene">

                        <!-- Scenes -->

                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}

                        {if $category->description}

                            <div class="cat_desc rte">

                            {if Tools::strlen($category->description) > 350}

                                <div id="category_description_short">{$description_short}</div>

                                <div id="category_description_full" class="unvisible">{$category->description}</div>

                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>

                            {else}

                                <div>{$category->description}</div>

                            {/if}

                            </div>

                        {/if}

                    </div>

{else}

                    <!-- Category image -->

                    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>

                        {if $category->description}

                            <div class="cat_desc">

                            <span class="category-name">

                                {strip}

                                    {$category->name|escape:'html':'UTF-8'}

                                    {if isset($categoryNameComplement)}

                                        {$categoryNameComplement|escape:'html':'UTF-8'}

                                    {/if}

                                {/strip}

                            </span>

                            {if Tools::strlen($category->description) > 350}

                                <div id="category_description_short" class="rte">{$description_short}</div>

                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>

                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>

                            {else}

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

                            {/if}

                            </div>

                        {/if}

                     </div>

                  {/if}

            </div>

{/if}

<h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}"><span class="cat-name">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)} {$categoryNameComplement|escape:'html':'UTF-8'}{/if}</span>{include file="$tpl_dir./category-count.tpl"}</h1>

{if isset($subcategories)}

        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }

<!-- Subcategories -->

<div id="subcategories">

<p class="subcategory-heading">{l s='Subcategories'}</p>

<ul class="clearfix">

{foreach from=$subcategories item=subcategory}

<li>

                <div class="subcategory-image">

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

{if $subcategory.id_image}

<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{else}

<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

{/if}

</a>

                    </div>

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

{if $subcategory.description}

<div class="cat_desc">{$subcategory.description}</div>

{/if}

</li>

{/foreach}

</ul>

</div>

        {/if}

{/if}

{if $products}

<div class="content_sortPagiBar clearfix">

            <div class="sortPagiBar clearfix">

            {include file="./product-sort.tpl"}

                {include file="./nbr-product-page.tpl"}

</div>

                <div class="top-pagination-content clearfix">

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

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

                </div>

</div>

{include file="./product-list.tpl" products=$products}

<div class="content_sortPagiBar">

<div class="bottom-pagination-content clearfix">

{include file="./product-compare.tpl" paginationId='bottom'}

                    {include file="./pagination.tpl" paginationId='bottom'}

</div>

</div>

{/if}

{elseif $category->id}

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

{/if}

{/if}
Link to comment
Share on other sites

  • 1 month later...

Hi everyonehow could I delete subcategory image? 

 

I tried to delete red part but then webpage doesn't work. Maybe someone could help me? What should I delete so the subcategory image won't appear in product page?

 

Thank you!

 

{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}
    {if $scenes || $category->description || $category->id_image}
<div class="content_scene_cat block">
            {if $scenes}
                  <div class="content_scene">
                        <!-- Scenes -->
                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
                        {if $category->description}
                            <div class="cat_desc cat-desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                        </div>
                    {else}
                        <!-- Category image -->
                                 <div class="content_scene_cat_bg scene_cat">
{if $category->id_image}
                    <img class="img-responsive" src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage"  /> 
                    
                    
                    {/if}
                        {if $category->description}
                            <div class="cat_desc cat-desc">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>
{/if}
<h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}">
<span class="cat-name">
{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)} {$categoryNameComplement|escape:'html':'UTF-8'}{/if}
</span>
Link to comment
Share on other sites

  • 1 month later...

Just for the record, a very small change is required to keep thumbnails, keep descriptions, and remove silly background image from the description:  change "cover" to "0 0" on background size css:

 

commenting out the whole thing will remove the descriptions.   So see the red:

 

-------

 

<!-- Category image -->
                     ]<div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:0 0; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>

Link to comment
Share on other sites

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

Oh Yea sorry. Its www.geturs.co.uk. Also just a warning its an upmarket sex toy and lingerie shop. (Just in case you're opening it at work.lol)

 

Kind Regards

hi, how did you make the categories in the top menu to not display subcategories until you will go with cursor over them?

Link to comment
Share on other sites

  • 3 weeks later...

using PS 1.6.1.2

 

and I can not remove subcategory images with des from the page. My category file :       (please help)

 

{*
* 2007-2015 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-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
    {if $category->id AND $category->active}
        {if $scenes || $category->description || $category->id_image}
            <div class="content_scene_cat">
                 {if $scenes}
                     <div class="content_scene">
                        <!-- Scenes -->
                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
                        {if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                    </div>
                {else}
                    <!-- Category image -->
                    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>
        {/if}
        <h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}"><span class="cat-name">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)} {$categoryNameComplement|escape:'html':'UTF-8'}{/if}</span>{include file="$tpl_dir./category-count.tpl"}</h1>
        {if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
        <!-- Subcategories -->
        <div id="subcategories">
            <p class="subcategory-heading">{l s='Subcategories'}</p>
            <ul class="clearfix">
            {foreach from=$subcategories item=subcategory}
                <li>
                    <div class="subcategory-image">
                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
                        {if $subcategory.id_image}
                            <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {else}
                            <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {/if}
                    </a>
                       </div>
                    <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'}</a></h5>
                    {if $subcategory.description}
                        <div class="cat_desc">{$subcategory.description}</div>
                    {/if}
                </li>
            {/foreach}
            </ul>
        </div>
        {/if}
        {/if}
        {if $products}
            <div class="content_sortPagiBar clearfix">
                <div class="sortPagiBar clearfix">
                    {include file="./product-sort.tpl"}
                    {include file="./nbr-product-page.tpl"}
                </div>
                <div class="top-pagination-content clearfix">
                    {include file="./product-compare.tpl"}
                    {include file="$tpl_dir./pagination.tpl"}
                </div>
            </div>
            {include file="./product-list.tpl" products=$products}
            <div class="content_sortPagiBar">
                <div class="bottom-pagination-content clearfix">
                    {include file="./product-compare.tpl" paginationId='bottom'}
                    {include file="./pagination.tpl" paginationId='bottom'}
                </div>
            </div>
        {/if}
    {elseif $category->id}
        <p class="alert alert-warning">{l s='This category is currently unavailable.'}</p>
    {/if}
{/if}

 

Link to comment
Share on other sites

  • 5 months later...

Hi. Please help. I am using 1.6.1.4. I am trying to remove the subcategory blocks but it does still shows even after I deleted the code in the category.tpl thats related to the subcategory block. Is there any other change in another file that I need to make as well? This is the code I removed:

 

{if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
 
<!-- Subcategories -->
<div id="subcategories">
<p class="subcategory-heading">{l s='Subcategories'}</p>
<ul class="clearfix">
{foreach from=$subcategories item=subcategory}
<li>
                <div class="subcategory-image">
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
{if $subcategory.id_image}
<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}
</a>
                    </div>
<h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'}</a></h5>
{if $subcategory.description}
<div class="cat_desc">{$subcategory.description}</div>
{/if}
</li>
{/foreach}
</ul>
</div>
        {/if}
 
{/if}
Edited by NewUser001 (see edit history)
Link to comment
Share on other sites

  • 4 months later...
×
×
  • Create New...