Jump to content

Hide category image in specific category


SebbC

Recommended Posts

Hi,

Sorry for my english (i'm french ;)),

I work with prestashop 1.6.1.17 and i need to disable/hide the category image only in a specific catégory (ID 55), just keep the title and link...

Somebody has already realized this modification or something similar ?

Can you help me ?

Thanks a lot,

Seb

 

Link to comment
Share on other sites

hi,

Thanks for your answer.

in category.tpl, there is this code :

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

I think that it is necessary to modify the code later {else} with the subcategory ID... i don't know the syntax.. to create that : "if no image in subcategory ID55 > Do not show the image"... 

I post a screenshot and the desired result... 

Thanks,

Seb

Screenshot1.thumb.jpg.d15f368dee398cdf6bf213cb1c7c6bdf.jpg

result.jpg

Link to comment
Share on other sites

Hi, yes it's what i want, i found a solution but i think it's not very clean, I modified the file category.tpl like that :

 

<div id="subcategories">
			<p class="subcategory-heading">{l s='Subcategories'}</p>
			<ul class="clearfix">
			{foreach from=$subcategories item=subcategory}
				<li>
                	<div class="subcategory-image">
						{if $subcategory.id_image==7
                        or $subcategory.id_image==21
                        or $subcategory.id_image==22
                        or $subcategory.id_image==23
                        or $subcategory.id_image==24
                        or $subcategory.id_image==25
                        or $subcategory.id_image==26
                        or $subcategory.id_image==27
                        or $subcategory.id_image==28
                        or $subcategory.id_image==29
                        or $subcategory.id_image==65
                        or $subcategory.id_image==69}
                        <img class="no-image" src="../../img/c/fr-default-no-medium_default.jpg" alt="" width="1" height="1" />
					{else} 
                            <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}">
                            <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}" />
						
						{/if}
					</a>

 

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