• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Solved]How to add a bg img to a div, different on each page
PostPosted: Fri Feb 25, 2011 7:09 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 695
Location: Western Australia
Just using HTML and CSS, I would give each page an id (body id="index">, body id="contactus">) and so on, so that I could change the CSS if necesary for individual pages.

I have a #sidebar that contains a #picturediv. I need to put a different image on each page as a background to the text in the #picturediv.

How is this sort of thing done in CMSMS?

Thanks.


Last edited by jasnick on Sat Feb 26, 2011 12:50 am, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How to add a bg img to a div, different on each page
PostPosted: Fri Feb 25, 2011 8:18 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 2071
Location: Feldkirchen in Kärnten, Austria
In your page template do something like:
Code:
</__body class="{page_alias}>


In your stylesheet do then:
Code:
body.home #picturediv {
 some: style;
}

body.contact-us #picturediv {
 some: otherstyle;
}

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How to add a bg img to a div, different on each page
PostPosted: Fri Feb 25, 2011 9:12 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 695
Location: Western Australia
OK - thank you very much - I will do that!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How to add a bg img to a div, different on each page
PostPosted: Fri Feb 25, 2011 3:49 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 2071
Location: Feldkirchen in Kärnten, Austria
just got reminded by Ronny on IRC that once again i wrote something stupid :)
So if you do use this dont forget $ before page_alias
Code:
</__body class="{$page_alias}>

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How to add a bg img to a div, different on each page
PostPosted: Sat Feb 26, 2011 12:48 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 695
Location: Western Australia
LOL - Thanks again! I'll mark this Solved now and post back if I have any difficulties.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting