WebsiteBaker Community Forum

General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: Fitzi on May 22, 2008, 01:18:57 PM

Title: change body background-image
Post by: Fitzi on May 22, 2008, 01:18:57 PM
Hello! I have following question:
How can I change my banner background-image (define in css), when I click a link to an other menue point.


CSS:
#BANNER {
width: 750px;
text-align: right;
margin-left: auto;
margin-right: auto;
height: 122px;
background-color: #FFFFFF;
background-repeat: no-repeat;
background-image: url(bg_back_1.jpg);         --> When somebody go to MenueLink2 - change it to bg_back_2.jpg
}
Title: Re: change body background-image
Post by: hrioo on May 24, 2008, 07:23:36 AM
You can create a 2nd template with bg_back_2.jpg and then assign this 2nd template to your menu2 page.
Title: Re: change body background-image
Post by: Ruud on May 24, 2008, 12:14:03 PM
Doing this in CSS is almost imposible.
You could also set that css line from the index.php and use the PAGE_ID variable to create a filename.
Just make sure you have an image for all pages (or build some php that checks for file_exists).

I could think of more tricks like this.
i.e.: Use the keywords field to set the name from the backend (and don't use the dynamic keyword META tag).
or: select a different CSS on the PAGE_ID of the current page.

There are several examples on this forum.
Have a look at this: https://forum.WebsiteBaker.org/index.php/topic,9284.msg54875.html#msg54875 (https://forum.WebsiteBaker.org/index.php/topic,9284.msg54875.html#msg54875)

Ruud