Jump to content

Showing subcategory images only when listing subcategory, not when in the subcategory


Recommended Posts

I like in 1.6 the new format of having a simpler display at the top of a subcategory with only the title and description, but setting it up this way (not having an image in subcategory in the back end); however, this leaves a blank box with a question mark for the image on higher level categories/subcategories.  I would like the subcategory images to only show at the higher category or subcategory listing at the top of the higher level listing and not in the actual sub category.  

 

In case this is not clear:

When displaying a top level category (backpacks), at the subcategory listing just bellow it, a listing of subcategories of backpacks is listed (for baby carrier packs, day packs, hydration packs, etc).  In this area I want the images for the subcategories to be displayed.  When one clicks on a subcategory to go to it, I do not want the image to display because I like the new black title bar with the title and description in white, and there is a bug that if you have an image here and text, the text overlaps the image and kills the black background, making the text disappear except as it goes through the image. If I delete the image for the subcategory, the actual subcategory looks great, but this makes the subcategory image in the higher level display (backpack level) show the box with the question mark.

 

Is there a way to just display the image for the subcategory only in the higher level and not in the actual subcategory?

 

I'm working on a test site using 1.6.0.8 updated from 1.4.4.1

Link to comment
Share on other sites

in category.tpl you can define if condition to check category level, if category level will be higher than X - then don't display backgrund image

 

the question is for what category levels you don't want this backgrund image.

Link to comment
Share on other sites

Thanks for the reply Vekia.  The only area I do not want the image to show up in would be the subcategory of the image itself, that is the only area I am running into the layout conflict with the image. 

Aside from this, as far as this new feature of prestashop, I do like the newer format for prestashop because in my observation of current trends in website design and related customer expectations, the newer design is much closer to the current.  When you get to the actual subcategory for the image/product level itself, having the image is redundant, unnecessary and without much use.  My initial thought is that this would likely be the lowest subcategory level in each case and the primary category/subcategory for the product displayed.  For me, the image I use is an image of one of the products for that specific category.

 

Thank you for identifying the category.tpl for defining this.  My coding capabilities are such that I would have no idea of how this might be coded or where in the category.tpl.  If you please, can you let me know what I should put in there to work this out?

 

Much appreciation Vekia.  :)

Link to comment
Share on other sites

in category.tpl you can define if condition to check category level, if category level will be higher than X - then don't display backgrund image

 

the question is for what category levels you don't want this backgrund image.

 Can someone please help me with the code for defining in the category.tpl an if condition to check the category level and if the category level is the same as the primary category of the product then don't show the image, otherwise show the image?  I get that it is a relatively simple task but I do not know coding/syntax that well.  Please....... :D

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

The following solution that eventually came out through another related topic solved the problem for me and did not require creating a new if statement.  Rather than deleting what was recommended, I just commented it out with {* and *} at the beginning and end of the code that was recommended to remove so that it can easily be undone later if needed. I do not like to modify prestashop core codes much to reduce potential interference with updates.

 

Here's the topic:http://www.prestashop.com/forums/topic/336016-category-image-problem/

 

Thank you Dioniz for your help and contributions and good job and NILAGolf_ for your topic on this to get the problem addressed!  I have been stuck on this problem for well over a month.  Your post has been the final step making it so that I can move forward with my update to 1.6.0.8 from 1.4.4.1

 

2 thumbs way up!  :D

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