Reputation: 1
I use PrestaShop 1.6 and I want to display an image when I'm on a specific category page and I want the image to be visibile on subcategories of that category.
{if $subcategory->id == 15}
style="background-position: 70% 72%; background-image: url(../img.jpg);"
{/if}
Upvotes: 0
Views: 641
Reputation: 1317
You can add the following code to the category.tpl file of your store:
{if $category->id_parent == 15} //For example the category ID is 15
.your_element_selector {
background-position: 70% 72%; background-image: url(../img.jpg);
}
{/if}
Note: You should create a separate element to show the image.
Upvotes: 1
Reputation: 1141
You could do something like this:
{if $subcategory->id == 15 || $subcategory->id_parent == 15}
style="background-position: 70% 72%; background-image: url(../img.jpg);"
{/if}
Upvotes: 1