Jump to content

Hide The Category Title When I Have A Category Image


Recommended Posts

Hi,

I would like to know how I can hide my category title when I have uploaded an image for my category.

I'm a noob in Php and after lot of many failed tests, I'm asking you.

 

Here is the code in my category.tpl file :

 

<!-- Category image -->
{if $category->id_image}
<div class="align_center">
<img class="img-responsive" 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"  />
</div>
                
                
{/if}
{/if}
 
{if $category->description}
            
            
<div class="cat_desc">
{if strlen($category->description) > 120}
<div id="category_description_short">{$category->description|strip_tags|truncate:120}</div>
<div id="category_description_full" style="display:none">{$category->description}</div>
<a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
{else}
<div>{$category->description}</div>
{/if}
</div>
{/if}
</div>
{/if}
        
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
<!-- <span class="resumecat category-product-count">
/ {include file="$tpl_dir./category-count.tpl"}
</span>-->
</h1>
 
 
So I want to had a display:none in my <h1> if there is $category->id_image
But I am not able to translate it in php :(

Thank you for your help !
Regards,
Thibault
 
 

 

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