What's the best way of implementing this? Do I need to create a php script or can I let Silverstripe select it automagically via "<% if LinkOrSection = section %>" or something?

Also, there's an image in the template that needs to change the same way as the css. It's not a background image, it's content. Can i add a variable in the url to the image to change it with the page accordingly?

Edit:
Maybe this is another (cleaner) solution:
Using <body id="$URLSegment"> and then specifying eight different body styles in the css file? But i figure this would only work for the specified items and not for the subnavigation...?

Look at tutorial 2 for extending a site. It shows you how to add an image to a page. That way you could upload the image for each page right in the CMS and then display it using a variable wherever you need.

$URLSegement usually works for what you're after, but if you want sub pages you could look at using InSection() if you don't want to write a css id/class for each.

Do something like <% if InSection(page-url) id="whatever" %> in the body tag. This would include all child pages of the section. So do all the top level pages. The drawback to this, would be you'd have to hardcode in the css stuff, and adding new top level pages would require updated CSS.

Of course the hard-coding of URL-Segments is hackish at best. I'd probably create a page that allows to select the "theme" using a dropdown in the CMS. This selection is then used in combination with Requirements::css(xy). Of course every page would inherit it's parent value.
The same approach can be used for your image problem.

Well, that might work, though it's not an optimal solution. What i'm actually looking for is something like a variable i can insert into an URL which returns the section name of the page you're viewing.

Is there any variable that returns the top section name as plain text? That way i can insert it into my body and photoholder div as an id. Then in my css file i can make the required changes to make it work. Keeps the template clean and all :)

I'm a bit of a SilverStripe newbie, so please forgive me if what I'm saying won't help you out.

I was looking over this question earlier today-- SHOCKED to find it's being discussed RIGHT NOW-- and believe I came up with the answer earlier.

Did you see this page on Page-Controls?
One of the most interesting ones that may help you here, is the "Controlling Certain Pages" section. It mentions that you can get access to the levels leading up to the current page you're on.

EG: Level(1) would return the top level of the section you are currently in.
I doubt that it will return a string. If it does, it could return a string with a space in it-- horrible for CSS. I believe it'll return an OBJECT of use to you.

If it returns an object, you can probably call Level(1).URLSegment (or is it Level(1)->URLSegment ? I'm a bit of a n00b, here.. ). If that works, you can use the URL segment as your ID/Class.

I hope slashes in IDs/Classes won't screw up CSS.

Let us know the solution you discover to your problem! I'd appreciate it, personally. 8) If I helped, so much the better.

EDIT ONE:
So it looks like you can't call $Level(2) like a variable. Maybe this'd be useful in future versions of SilverStripe?

Regardless, the following code DOES work, and IS tested. The above code (calling it) will cause your template files to be invalid, and you will have to clear them out of where they are. (EG: In your PHP temp folder. )

@Flowz0r: you can simply use the $URLSegment as your "section-name". It is the URL part you enter in the cms and is unique. You should be aware, that a user can change this URLSegment in the cms and therefore break the functionality of your system.
I'm not sure why you're against the solution i posted. So far it seems to be the most flexible and stable approach and it doesn't add anything that clutters your template. Everything is taken care of in the Controller (php code, not template).