By roborracle on
I'm trying to use page-blog.tpl.php to control my blog pages, and all is well, except for one thing. I can't seem to figure out a way to declare a second set of styling for this page. There are some elements that I've set that I've added specific styling for such as
with the corresponding style set in the ID on the main style.css. But, I can't seem to find a way to do that for the "body" element and that is where I have a specific background image stored. So for instance, the main page.tpl.php would have something like this:
body {
background-image: url(images/primaryimage.png);
background-repeat:no-repeat;
background-position:top center;
}
and the blog pages need to have
body {
background-image: url(images/SECONDARYimage.png);
background-repeat:no-repeat;
background-position:top center;
}
If anyone has any idea as to how I might accomplish this I'd be most grateful.
Comments
...
well, i believe you simply need to define an overall class or id in your blog template page and then use that to control the body.
mine has
<div class="node-blog">wrapping everything on the page, but you can put anywhere that makes sense for the sytling outcome you want.so, for instance, the css becomes something like this:
Thanks for the reply!
I'm trying that and I'm not really getting the result that I want unfortunately. I'd really like to be able to use a second stylesheet for these pages - it would seem that would be easiest, but I can't figure that out either.
okay - thinking out loud here...
is there a module that would allow you to set your style by page? I know that in previous experience with Dot Net Nuke there was a way to determine which theme an individual page uses. I've long since abandoned any effort to use DNN, but think such functionality might be useful.
I was able to set a default theme that would apply unless a page-specific theme was chosen. I'm sure that Drupal being as powerful as it is has to have something similar to this, I've just not figured it out yet...
Okay - solved
I made an error previously when adding the classes/ids to my stylesheet. Adding these with the appropriate styling did the trick
.page-blog, .node-type-blog, .page-contact, .page-faq, .page-admin, .page-user