Jump to content

Background image on homepage only


trustport

Recommended Posts

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

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

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

 

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

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