biumbria Posted March 2, 2017 Share Posted March 2, 2017 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 More sharing options...
shokinro Posted March 3, 2017 Share Posted March 3, 2017 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 More sharing options...
biumbria Posted March 3, 2017 Author Share Posted March 3, 2017 hi thank you for the answer, but i meant the header background image not the image of the category banner, so in every category i would want a different header background image Link to comment Share on other sites More sharing options...
shokinro Posted March 3, 2017 Share Posted March 3, 2017 if that is the case, then you will have to make some custom themes to your theme, to add some code your theme file header.tpl to implement this feature. Link to comment Share on other sites More sharing options...
biumbria Posted March 3, 2017 Author Share Posted March 3, 2017 o, thank you, but someone could help me on how to change the code? Link to comment Share on other sites More sharing options...
HanzCZ Posted March 3, 2017 Share Posted March 3, 2017 (edited) 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 March 3, 2017 by HanzCZ (see edit history) Link to comment Share on other sites More sharing options...
biumbria Posted March 3, 2017 Author Share Posted March 3, 2017 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 Link to comment Share on other sites More sharing options...
HanzCZ Posted March 7, 2017 Share Posted March 7, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now