Changing background color to a background image.

jgrabert

Joined: 2005-05-15
Posts: 7
Posted: Wed, 2005-10-26 21:27

I just upgraded to the lastest version of 2 (I was still using 1 until a few days ago). I figured out how to change what I wanted, EXCEPT for changing the background to an image. I can change the color all I want, but for some reason, every code I have tried hasn't worked. Is there something special I have to put to make the background image show up?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2005-10-27 06:00

Can you post the code you've tried, then maybe we can find what you've been doing wrong.

This is all you should need to do to make it work EXAMPLE:
background: url('images/backgroundimage.gif');

The file has to be referenced from where your .css file is located. Meaning in the above example, if my theme.css file was located in /themes/matrix/ then that image file would have to be located in /themes/matrix/images/.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jgrabert

Joined: 2005-05-15
Posts: 7
Posted: Thu, 2005-10-27 15:47

Well, I supposed that would work, except I want trying to change it in the colorpack. Do I have to change it inside of the theme? I'll go try to and see how it works out! Thanks for the info

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2005-10-27 17:33

You didn't mention anything about a colorpack :) You should be able to do it there as well since most of the colorpacks I've tried out change those colors.

Here's an example from the black colorpack:

#gallery a { color: #00a0ff !important; }
#gallery a:hover { color: #cccc00 !important; }
#gallery a:active { color: #cccc00 !important; }

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jgrabert

Joined: 2005-05-15
Posts: 7
Posted: Thu, 2005-10-27 23:46

I'm sorry! I figured that was the only way you could change a background. I tried looking on the theme itself and it just didn't seem to have anything anywhere. In the .css on the colorpack, where do I change the code? I figure its the second line in the top of color.css. I'm usually pretty savvy when it comes to html and css, but I am stumped!

#gallery {color: #660000 !important;
background-color: #FEE8D6 !important;} <----is this what I need to change? What should I change it to?
body.gallery { background-color: #FEE8D6 !important;}

Also, where should I store the images? I figured in gallery/images, but I suppose not. Thanks for any help and thanks for your patience, I'm getting so frustrated!

 
jgrabert

Joined: 2005-05-15
Posts: 7
Posted: Thu, 2005-10-27 23:57

Ok, never mind, I figured it out. There isn't really anyway to search the forums, I looked through 10 pages with nothing, so I started my own forum. I looked on google and found another forum, and you were the one that solved it for me! Thanks a bunch! For anyone else wanting to know, here is how your colorpack color.css should look:

#gallery {color: #660000 !important;
background-image:url(http://www.example.com/background.gif)}
body.gallery { background-color: #FEE8D6 !important;}

It works! Thank you so much :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2005-10-28 14:19

You can search the forums, but it's not the best sometimes.

Thanks for posting your solution, hope it helps someone else.

Personally, if you're doing this in a colorpack, I'd probably copy that colorpack to a new one so it doesn't get overwritten on an upgrade as well as putting the image in with the color pack and referring to that image from where your color.css file lives. This way your colorpack can be a bit more portable and doesn't have to reference a full URL.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
morgannygren

Joined: 2006-05-29
Posts: 1
Posted: Mon, 2006-05-29 03:40

I got it to work (ignore my old post below) I changed the theme.css in its original location in the Matrix folder, not the copy I made to the 'local' folder and bang. I changed the following items to my bg image (thanks anyways!):

Assuming you're using Matrix, scroll down the the part of theme.css that starts with
/* ******************************************************************************** * Matrix Theme for Gallery 2 * by Ross A. Reyman, Jon Huang, and Chad Kieffer * updated by Alan Harder */

and edit these classes:

#gallery {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333;
background: url('templates/local/bg.color.1x1.jpg');
}
body.gallery {
background: url('templates/local/bg.color.1x1.jpg');
}

.gcBackground1 {
background: url('templates/local/bg.color.1x1.jpg');
}

.gcBackground2 {
background: url('templates/local/bg.color.1x1.jpg');

---------- old post -------
Hello, I am new and I have been looking trough alot of the forum and documentation. I am trying to change the background color of the Matrix Gallery 2 that I just installed. I added the line you mention above [ background: url('backgroundimage.gif'); ] and I saved my backgroundimage in the same directory as my CSS file (in 'local' folder). Nothing happens. I cleared my IE cache etc., before viewing.

I tried adding above line in under both "#gallery" and "body.gallery" in the theme.css but nada, man. I tried just changing the bg color but that doesnt do anything either.

Once, I got to a point (after changing all kinds of stuff in theme.tpl, theme.css, and album.tpl) where the Gallery 2 visually embeded in my site and the background was changed to my bg image by adding it to my table background in my HTML for the page that I am using the Gallery 2 in, but I still had some gray in the banner at top, where the gallery name and login and register links are. What's a foolproof way of changing the bg color or using a bg image? Sorry for asking this question because I know it's probably 101 but I just can't get it to work. Thanks for any help. /Morgan