trustport Posted August 15, 2017 Share Posted August 15, 2017 Hello, how can i put the background image on homepage only. I tried the: #wrapper { /*background: #fff!important;*/ background: url(../img/aa.jpg)} } but it apply to all of the page. any help? here the site http://www.trustport.com.my/dev/estore/en/ Link to comment Share on other sites More sharing options...
trustport Posted August 16, 2017 Author Share Posted August 16, 2017 Hi, Use this code in header.tpl: {if $page_name=='index'} <body id="the_one_you_want" class="the_one_you_want"> {else} <body id="as_you_like" class="as_you_like"> {/if} You can not achieve it with css only you have to adapt the header accordingly. I'm newbie in using prestashop. can u help me how to apply that? what to put inside body_id and class. thanks Link to comment Share on other sites More sharing options...
vekia Posted August 16, 2017 Share Posted August 16, 2017 homepage <body> element has own unique class and ID so you dont have to modify any .tpl file. for example: body#index { background: red; } it will add red background only for "index" page which is just homepage. 1 Link to comment Share on other sites More sharing options...
trustport Posted August 16, 2017 Author Share Posted August 16, 2017 homepage <body> element has own unique class and ID so you dont have to modify any .tpl file. for example: body#index { background: red; } it will add red background only for "index" page which is just homepage. Hello vekia, thanks for helping. I tried as u suggest but i does not work. i put the code inside custom.css. my version is 1.7 prestashop http://www.trustport.com.my/dev/estore/en/ Link to comment Share on other sites More sharing options...
vekia Posted August 16, 2017 Share Posted August 16, 2017 Hello vekia, thanks for helping. I tried as u suggest but i does not work. i put the code inside custom.css. my version is 1.7 prestashop http://www.trustport.com.my/dev/estore/en/ it works but your page has wide container with ID #wrapper that has own background: http://i.imgur.com/7ypVWkS.gifv you have to define styles to #wrapper, not for body for example: #index #wrapper { background:red; } Link to comment Share on other sites More sharing options...
trustport Posted August 17, 2017 Author Share Posted August 17, 2017 it works but your page has wide container with ID #wrapper that has own background: http://i.imgur.com/7ypVWkS.gifv you have to define styles to #wrapper, not for body for example: #index #wrapper { background:red; } Oh i see.. that the only thing i miss... just #index in the front to make it work on homepage only.. Its working now. Thanks vekia for helping. 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