Jump to content

Display subcategories as image links instead of text links


docprego@me.com

Recommended Posts

As far as I can see you are using imges already, in the shop by category page. Do you mean something else?

That is correct, I am using images for my main categories such as Abstract, Animals, Artwork, etc..

 

What I am talking about are the subcategories that appear once you click on one of my category image buttons. On the page that loads after clicking a main category button there are text links. For example if you click on the Animals button, 12 different types of animals load up as text links including Bears, Birds, Cats, etc.. It's these text links I'd like to display as image links similar to the main categories that contain these text links.

 

Thank you.

Link to comment
Share on other sites

For that, you need to edit category.tpl, the div with id="subcategories", you have some h5s there. You can use  the standard code

 

{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}" />
{/if}
Link to comment
Share on other sites

I greatly appreciate your reply. However, I am not clear on exactly how to do this. Can you please explain further?

 

Thank you

 

For that, you need to edit category.tpl, the div with id="subcategories", you have some h5s there. You can use  the standard code

 

{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}" />

{/if}

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