I have installed the Cleaner by Default 2-Column template and would like to randomly change my header image banner when customers click on different pages. Ideally there would be 5 different banners which would appear.
The Cleaner by Default 2-Column template can be found here:
http://www.opencart.com/index.php?route ... order=DESC
Any help on what code to add and where to add it would be appreciated.
Thanks!
Karim
Hi Karim, sorry for not replying sooner.
Firstly you need to create your 5 banners - name them header-bg-1.jpg, header-bg-2.jpg, header-bg-3.jpg etc.
Then in your stylesheet change
to
Finally, in your header template find <div id="cmtop-banner"> and change it to
That should work.
Firstly you need to create your 5 banners - name them header-bg-1.jpg, header-bg-2.jpg, header-bg-3.jpg etc.
Then in your stylesheet change
Code: Select all
#cmtop-banner {
background: #144a92 url('../image/header-bg.jpg') top left no-repeat;
height: 150px;
width: 960px;
}
Code: Select all
#cmtop-banner {
height: 150px;
width: 960px;
}
Code: Select all
<div id="cmtop-banner" style="background: #144a92 url('catalog/view/theme/<?php echo $template ?>/image/header-bg-<?php echo rand(1, 5); ?>.jpg') top left no-repeat;">
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
Who is online
Users browsing this forum: No registered users and 30 guests