Jump to content

set different header image for each category


biumbria

Recommended Posts

Hi everybody i'm Antonio, i'm new at prestasho and i'm just setting up my web site that is www.umbriacato.it i bought the coffè store theme, is nice but there is a think that i need to do, i want to set different header image on the category page depending on which category are you seeing, could you help me to do this? 

 

Thank you

Link to comment
Share on other sites

At store back office - Catalogue - Categories page.

choose any category you want to edit and choose "edit" from action column. you will see category editing page.

on this page you will be able to upload a cover image for the category - this cover image will be your header image.

Link to comment
Share on other sites

It should be possible by javascript/jQuery... script must detect position (for example query in URL)  and than change/add css class with specific parameters. If url query string = "category-name" > change css parameters... This solution will work, if your PS has URL like domain.com/category-name/product

 

http://stackoverflow.com/questions/195951/change-an-elements-class-with-javascript

 

Script for detect string in URL:

var query = window.location.search.substring(1);
if (-1 != query.search('category-name') ) {

	// change css class; add css class or something like that

}
Edited by HanzCZ (see edit history)
Link to comment
Share on other sites

It seem difficoult i really dont know how to do it, i have found this topic : https://www.prestashop.com/forums/topic/60494-multiple-css-for-the-site-depending-on-selected-category/?hl=%20multiple%20%20category%20%20css

it seem the same think that i'm tring to do but it is related to a very old version of prestashop so i dont know if it could work

 

Smarty solution will be better ofc then my javascript, but do the same thing. Try the tutorial you posted. I don't know smarty variables and assigning them... Maybe blockcategories,tpl or some controllers can be helpful for finding right variables...

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