Editable background image

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
michaelp
New Member
New Member
Posts: 4
Joined: Tue Jul 21, 2009 2:02 pm

Editable background image

Post by michaelp »

Hi Everyone!

i´m new to cmsms and have a pretty basic question.
Is it possible to edit a background image of a template?
The problem is that i can hardly fix my layout without using a background image - but this image must be editable by editors ...
I´m coming from TYPO3 where this is not (really easy) possible.

Any help appreciated - i´m still in the progress of building my templates, which i have to have ready by tomorrow.

So long,
Michael
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Re: Editable background image

Post by tophers »

I'm going to assume that you don't expect the editors be able to alter the actual image, but rather to specify which background image to use. That could get tricky (though I imagine that by saying so I'll be eliciting a few responses to the contrary!), but there are several simple ways to accomplish this.

It all comes down to templates. You could:

1) Build different templates that have different background images specified, allowing the editor to choose which will show up, or;

2) Code the template so that in pulls in a variable based on where you are in the site. The following code in your template (in conjunction with the CGSimpleSmarty Module) will assign a body class equal to the page alias of the section you are in:

Code: Select all

{$cgsimple->get_root_alias('','root_alias')}
</__body class="{$root_alias}">
From there, you simply style your css 'hang' on this code - ie:

Code: Select all

.home body {background: #fff url(uploads/images/home_bkgd.gif) repeat-x center top;}
.about body {background: #fff url(uploads/images/about_bkgd.gif) repeat-x center top;}
etc.
I hope this points you in the right direction, or at least prompts some more targeted questions. If you have a link or example to post, please do - it'll help us answer your questions.
Post Reply

Return to “Layout and Design (CSS & HTML)”