Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

AndyC

Remove Sub Category Images

Recommended Posts

Hi How can we remove the image blocks from Sub Categories on the default theme Thank You

Share this post


Link to post
Share on other sites

If you are using the default theme you can comment out lines 63 through 80 in the category.tpl folder. Be sure to use the proper smarty tags. i.e: {* unwanted content *}

Share this post


Link to post
Share on other sites

Rather a old post of mine.. I tried this with Panda and it didn't work at all

But I am trying again to remove the image block from categories . I have tried a few ideas from Prestashop but none work.

So in the example below , once you open a category from either your side or top , you normally get all the other subcategories showing at the top

All I want is the wording as the images take up too much space

Capture.JPG.74d6dd213d0590d094bbace98c1ed484.JPG

 

Or if there is a way to change the size of the image , but then remove the text

Edited by AndyC

Share this post


Link to post
Share on other sites

themes / panda / category.tpl

you can delete it

                    <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}
                            {assign var='pro_image' value=$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}
                            {if isset($sttheme.retina) && $sttheme.retina}{assign var='pro_image_2x' value=$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default_2x')}{/if}
                            <picture>
                            {if isset($webp) && $webp}
                            <!--[if IE 9]><video style="display: none;"><![endif]-->
                            <source
                                srcset="{$pro_image|regex_replace:'/\.jpg$/':'.webp'}
                                {if isset($sttheme.retina) && $sttheme.retina},{$pro_image_2x|regex_replace:'/\.jpg$/':'.webp'} 2x{/if}"
                                title="{$subcategory.name|escape:'html':'UTF-8'}"
                                type="image/webp"
                                >
                            <!--[if IE 9]></video><![endif]-->
                            {/if}
                            <img src="{$pro_image}" {if isset($sttheme.retina) && $sttheme.retina} srcset="{$pro_image_2x} 2x"{/if} alt="Kategorie {$subcategory.name|escape:'html':'UTF-8'}" title="Kategorie {$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                            </picture>
                        {/if}
                    </a>

 

or comment out 

<!--
                    <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}
                            {assign var='pro_image' value=$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}
                            {if isset($sttheme.retina) && $sttheme.retina}{assign var='pro_image_2x' value=$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default_2x')}{/if}
                            <picture>
                            {if isset($webp) && $webp}
                            <!--[if IE 9]><video style="display: none;"><![endif]-->
                            <source
                                srcset="{$pro_image|regex_replace:'/\.jpg$/':'.webp'}
                                {if isset($sttheme.retina) && $sttheme.retina},{$pro_image_2x|regex_replace:'/\.jpg$/':'.webp'} 2x{/if}"
                                title="{$subcategory.name|escape:'html':'UTF-8'}"
                                type="image/webp"
                                >
                            <!--[if IE 9]></video><![endif]-->
                            {/if}
                            <img src="{$pro_image}" {if isset($sttheme.retina) && $sttheme.retina} srcset="{$pro_image_2x} 2x"{/if} alt="Kategorie {$subcategory.name|escape:'html':'UTF-8'}" title="Kategorie {$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                            </picture>
                        {/if}
                    </a>
-->


EDIT:

subcategory without image

Edited by colorful-ant

Share this post


Link to post
Share on other sites
On 1/23/2021 at 11:23 PM, colorful-ant said:

or comment out 

Better comment out with Smarty comment delimiters rather than HTML delimiters. Theses are {* and *}. HTML comments get interpreted and delivered to the browser. Smarty comments not, so it it improves performance a bit.

P.S.: as one can see by the code coloring in your post, the HTML comment ends in line 7 already, because there's another HTML comment. This means invalid HTML. Another reason to use Smarty delimiters.

Edited by Traumflug
  • Like 1

Share this post


Link to post
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...