X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Removing category names under category image (https://forum.x-cart.com/showthread.php?t=77833)

razorbackrinds 05-31-2020 09:57 AM

Removing category names under category image
 
1 Attachment(s)
I am sure that this has probably been asked a thousand times so I will apologize in advance for my ignorance here.


Is it possible to remove the Category Name when there is an image for the category?


For example, in the attached image, I would like to remove the names of the categories as the category image states the name.

Ed B. 07-03-2020 11:50 PM

Re: Removing category names under category image
 
You need to override customer/subcategories/icons/body.twig
See https://devs.x-cart.com/getting_started/how-to-apply-design-changes.html#seeing-structure-of-specific-page for more.

siddharth.puri@wheelandba 07-09-2020 06:09 PM

Re: Removing category names under category image
 
I modified this in theme_tweaker/customer/subcategories/icons/body.twig

However I have not worked with version 5.4

{##
# Subcategories list (grid style)
#}

{% if this.getSubcategories() %}
<ul class="subcategory-view-icons subcategory-list grid-list clearfix">
{% for subcategory in this.getSubcategories() %}
{% if subcategory.hasAvailableMembership() %}
<li>
<a href="{{ url('category', '', {'category_id': subcategory.category_id}) }}">
<span class="subcategory-icon lazy-load">
{{ widget('\\XLite\\View\\Image', isBlurApplicable=true, image=subcategory.image, maxWidth=this.getIconWidth(), maxHeight=this.getIconHeight(), centerImage='1', alt=this.getAlt(subcategory.image)) }}
</span>
//MAKE MODIFICATION HERE
{% if this.category.name != 'NAME OF THE CATEGORY YOU WANT TO HIDE NAMES FOR' %}
<span class="subcategory-name">{{ subcategory.name }}</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
{% for item in this.getNestedViewList('children') %}
<li>{{ item.display() }}</li>
{% endfor %}
</ul>
{% endif %}
{{ widget_list('subcategories.base') }}


All times are GMT -8. The time now is 12:52 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.