Jump to content

How To Change The Code Of An Already Modified Code To Make Background Image Appear Only In Home...


Recommended Posts

I placed an image to the background of the prestashop default theme by pasting:  background: #FFF url('../themes/default-bootstrap/img/cloud3long.png')!important;

to the global.css file in the css folder of my theme and after ofcourse uploading the image to the image folder of the theme.
If I want this background image to appear in the home page only, how should I modify this code?
Thank you
Edited by De La Riviere (see edit history)
Link to comment
Share on other sites

If you just need to make change in homepage then you can edit below file

/classes/controller/FrontController.php

 

Search for function addMedia

 

and add below code in it

 

if($this->context->smarty->tpl_vars['page_name']->value == 'index') // checking if it is homepage
   echo "<style>#header_logo {display: none !important;}</style>";
 

 

We also has a module which allows you to add Custom CSS and JS on any specific page of your website. You can even decide that css should be apply to mobile or desktop or on both of them.

Link to comment
Share on other sites

If you just need to make change in homepage then you can edit below file

/classes/controller/FrontController.php

 

Search for function addMedia

 

and add below code in it

 

if($this->context->smarty->tpl_vars['page_name']->value == 'index') // checking if it is homepage
   echo "<style>#header_logo {display: none !important;}</style>";
 

 

We also has a module which allows you to add Custom CSS and JS on any specific page of your website. You can even decide that css should be apply to mobile or desktop or on both of them.

Sorry, but I tried as you said and it doesn´t work... Background image still appears in all pages, not just home page as intended.

Link to comment
Share on other sites

Sorry and thanks for your reply, but I see no point in this code and after trying it in all possible ways, nothing happens in the front shop. My original question was: 

 

"I placed an image to the background of the prestashop default theme by pasting:  background: #FFF url('../themes/default-bootstrap/img/cloud3long.png')!important;

to the global.css file in the css folder of my theme and after ofcourse uploading the image to the image folder of the theme.
If I want this background image to appear in the home page only, how should I modify this code?
Thank you"
 
Are you sure that we are talking about the same thing?
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...