Switching Background Image?

About the template and stylesheet - and changing the menu
Post Reply
Uta13
Posts: 41
Joined: Sun Sep 07, 2008 6:53 pm

Switching Background Image?

Post by Uta13 » Sun Sep 07, 2008 7:26 pm

Hello,

I am a CMSimple beginner and just love it! Iam currently creating a website that requires a different background image in one of the divs on each page.
I searched a bit for a solution of my problem and found this:

http://cmsimplewiki.com/doku.php/tips_a ... background

Looks like excaclty what I need. But...for some reason it doesn´t work for me and I just cannot find the mistake. Does anyone know what´s the problem?

I inserted this code in my template.htm (in my div"contentbox"):

Code: Select all

<div id="contentbox" style="background:url(<?php if ($mybackground==''){echo $pth['folder']['templateimages']; ?>default<?php }else{echo $pth['folder']['templateimages'].$mybackground;} ?>.jpg) no-repeat center 0px;"><div id="admincontent"><?php echo editmenu();?>
        <div id="pagecontent"><?php echo content();?><?php echo submenu();?></div>
    </div></div>
  </div>
And I placed the default.jpg and another picture called 2.jpg im my template image folder.

Here you can see the site where I tried all this: http://www.klemenssander.at/seitenkunst/hwq/
For the beginning, I wanted to switch the background of "contentbox" on the page "termine" to 2.jpg and inserted this code: #CMSimple $mybackground=”2“;# .
Also tried 2.jpg etc...but it just won´t work.

Thanks for any help!

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Switching Background Image?

Post by Holger » Mon Sep 08, 2008 7:22 am

Hi Uta13,

seems that there's an error in your CMSimple-Scripting.
The quotes are not right. Maybe an error by copy'n paste from the Wiki.
Uta13 wrote:and inserted this code: #CMSimple $mybackground=”2“;# .
Try

Code: Select all

 #CMSimple $mybackground="2";#

Holger

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Switching Background Image?

Post by Holger » Mon Sep 08, 2008 8:26 pm

Hallo Uta,

scheint ja jetzt zu funktionieren ;) .
BTW: Sehr schöne Seite!

Holger

Sorry, falsche Boardsprache :oops:

Uta13
Posts: 41
Joined: Sun Sep 07, 2008 6:53 pm

Re: Switching Background Image?

Post by Uta13 » Mon Sep 08, 2008 8:29 pm

Hallo Holger,

danke für die Blumen und vor allem vielen, vielen Dank für die schnelle Hilfe, es hat dann gleich funktioniert! Muß nächstes Mal aufpassen mit Copy&Paste...

LG Uta

Uta13
Posts: 41
Joined: Sun Sep 07, 2008 6:53 pm

Re: Switching Background Image?

Post by Uta13 » Mon Sep 08, 2008 8:31 pm

...ist ja auch einfacher auf deutsch ;)

Post Reply