Matrix Theme: Vanishing background
Garney
Joined: 2008-11-07
Posts: 3 |
Posted: Fri, 2008-11-07 21:46 |
http://www.lemontoss.com/kennel/owners/main.php Here I have my new gallery, looking exactly the way I want it after many rather basic tweaks to the theme.css and creating a local .tpl file. I'm not going for amazing changes here, I seem to be stuck on the simple. When you click on any of the galleries, my background image vanishes and the entire thing is white. However, if you edit anything, the background image returns, and it is even present in the admin panel - the only thing wrong is the galleries down to viewing the individual items. Are these pages using another overriding .tpl that I need to edit? Shouldn't it all be overridden by the local .tpl I created? Or am I just missing removing some background color: #FFFFFF somewhere in the theme.css? |
|
Posts: 16504
It's all a path issue. Your main album right now is at:
http://www.example.com/kennel/owners/main.php
When you click on any of the albums you go here:
http://www.example.com/kennel/owners/v/AlbumName
Your bg image is loaded from here:
http://www.example.com/kennel/owners/images/body_background.jpg
but called like this:
images/body_background.jpg
So that image would have to be here:
Your bg image is loaded from here:
http://www.example.com/kennel/owners/images/body_background.jpg
and here:
Your bg image is loaded from here:
http://www.example.com/kennel/owners/v/images/body_background.jpg
The fix would be putting that images directory under your theme's directory along with ALL css changes.
You can put your css changes in a local directory (along with the images your css calls) so any upgrades don't over write those changes.
/themes/matrix/local/theme.css
/themes/matrix/local/images
Images loaded from css are loaded relative to where the css lives. So if you just put your changes into local/theme.css along with the images called from there into local/images/ then you can load that background image just like you already are.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 3
Thank you very much for the reply.
I've attempted several of the paths you suggested, but none of them seem to work correctly. I added an images folder to the local directory and discovered that it placed the background image over several places I had been experimenting in the theme.css (such as the actual image odd and even backgrounds) so I had to remove those and set them back to background color: #FFFFFF
However, I don't have a /v directory, let alone a /v/images directory. When I created one manually and added the background to an /images folder, it didn't change the way the albums rendered after clearing the template cache and hitting a hard refresh. So I'm a bit boggled as to why the albums are creating this apparent /v path when one doesn't exist that I can see.
Is there some way to do a fixed path in the theme.tpl
Posts: 16504
No, and you never should, ever. Gallery with URL Rewrite enabled, creates the /v/ and all sub-"directories" on the fly.
However, the browser doesn't know that and it's looking that the path.
What you did, didn't work because any and every URL with /v/path-to-image gets processed by the URL Rewrite rules and does database lookups to find where it really is.
If you want to leave your stuff as is, disable and uninstall the URL Rewrite module and it will start working, but you'll loose pretty URLs.
If you want pretty URLs, move all of your css code from theme.tpl or album.tpl or photo.tpl (where ever you put it). Put it in theme.css (at the bottom so those changes over write everything else in there or comb through the code to find anything that's conflicting and clean it up)
MOVE theme.css to themes/YourTheme/local/theme.css
move or copy /kennel/owners/images/body_background.jpg to themes/YourTheme/local/images/body_background.jpg
You shouldn't need to change any paths, just leave it all as is. That should work.
If you're editing template files be sure to clear the template cache after making changes and/or be sure that saving cached template pages is turned off.
Site Admin > Maintenance for clearing the cache
Site Admin > Performance for turning off Gallery's template caching feature (and clearing saved pages, I don't know if this is the same or different than the maintenance option)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 3
Ah ah! I had forgotten all about the URL Rewrite! Of course that directory doesn't exist.
After disabling the pretty URLs my background shows just fine. Thank you very much!
Of course, I rather like the pretty URLs, so I might have to fiddle with your other suggestions later when I've had more caffiene and I'm not making such stupid mistakes.
(Yes, I'm quite addicted to that lovely template clearing device in the site admin, it is love.)
So if I work entirely in the theme/local area it automatically overrides the basic theme that came with gallery? Excellent, I had moved theme.tpl to local, but I didn't know that theme.css would behave the same way if I moved it. I now have everything tucked safely inside local to experiment with when I get brave again.
Posts: 16504
Yep, that's the way templates work. With 2.3 it gets even better. Read more here: http://codex.gallery2.org/Gallery2:Editing_Templates
And you might want to read through these pages:
http://codex.gallery2.org/Gallery2:Themes:How_to_Copy_an_Existing_Theme
http://codex.gallery2.org/Gallery2:Themes:Developing:Overview
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here