Hello,
Can anybody please tell me How Can I have different Background color (Body color) for HOME PAGE and OTHER PAGES in OPENCART site?
For Example: I want to use brown background in HOME PAGE and cream background in all other pages of site.
I can see in stylesheet.css
---------------------------------------------------------------
Body {
background: url(../image/.....png) repeat-x;
}
-----------------------------------------------------------------
From where I can only set only one background for all pages.
BUT I would like to use two different body-color(background) for HOME PAGE and OTHER PAGES.
Is that possible? How Can I do that?
Expecting help.
Sincerely,
-J
Can anybody please tell me How Can I have different Background color (Body color) for HOME PAGE and OTHER PAGES in OPENCART site?
For Example: I want to use brown background in HOME PAGE and cream background in all other pages of site.
I can see in stylesheet.css
---------------------------------------------------------------
Body {
background: url(../image/.....png) repeat-x;
}
-----------------------------------------------------------------
From where I can only set only one background for all pages.
BUT I would like to use two different body-color(background) for HOME PAGE and OTHER PAGES.
Is that possible? How Can I do that?
Expecting help.
Sincerely,
-J
File header.tpl in your theme folder (I am assuming you use default theme)
Find
Replace with
This will attach CSS class "home-page" to body tag on home page.
BTW, never expect anything on free forums
Find
Code: Select all
<body>
Code: Select all
<body <?php echo (!isset($this->request->get['route'])) ? 'class="home-page"' : '' ?>>
BTW, never expect anything on free forums

hi dizarter,
It didn't work. I replaced the <body> in header.tpl with your code.
and created class 'home-page' in style sheet with different color background.
BUt it is not working.
BTW, I am using some different theme. If you want to see my header.tpl file I could provide you.
Thanks
-J
It didn't work. I replaced the <body> in header.tpl with your code.
and created class 'home-page' in style sheet with different color background.
BUt it is not working.
BTW, I am using some different theme. If you want to see my header.tpl file I could provide you.
Thanks

-J
CSS code should be something like
As you see, this should come after existing styles for body, or it will get overwritten.
Code: Select all
body {
...
existing styles
...
}
body.home-page {
...
your-styles-here
...
}
try this it will work
<?php if(!isset($this->request->get['route']) or $this->request->get['route']=="common/home"){?> class="your-class" <?php }?>
<?php if(!isset($this->request->get['route']) or $this->request->get['route']=="common/home"){?> class="your-class" <?php }?>
I think this module will make your work easer http://codecanyon.net/item/custom-backg ... el/2902104
Who is online
Users browsing this forum: No registered users and 19 guests