Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Different header pictures for menu label


Go to End


3 Posts   2562 Views

Avatar
vinz

Community Member, 13 Posts

10 April 2008 at 10:05am

Hi there,
i would like to have for each page a different picture in the header.... llike... home-->pic1 ; about us-->pic2, etc.
How can I do it with css?
could someone giv eme a help. Could you also give me some code or a web page to show me the result...
thx in advance for any help.

Avatar
Liam

Community Member, 470 Posts

10 April 2008 at 1:07pm

I would just set an ID on your body tag and then use css to style specific pages.

So something like <body id="$URLSegment"> in your template, and then your css

#header{background:imageurl;} //default image

#segment1 #header {background:imageurl;}

#segment2 #header{background:imageurl;}

Then your html header should be <div id="#header">Stuff</div>

If you add new pages, you'd have to manually update your css stylesheet, or it'll give the default image.

You could also search the forum, I believe there was a method which allows you to upload and handle the images per page in the backend CMS. Depends on which way you wanna go.

Avatar
vinz

Community Member, 13 Posts

10 April 2008 at 9:54pm

Hi LeeUmm,
sorry but could you explain me better what I should do..sorry. I have no idea which file I should change and what I have to change to make it work, I'm not so confident with silverstripe and css...
Hope you can give me a help..
thx