I wanted to overlay a logo image on rotating banners in beautiful Marinelli theme, but this feature is not implemented.
So I modified style.css and page.tpl.php - I'm using Drupal 5.x, so changes are applied to Marinelli Theme 5.x-1.2 (2008-Jun-18).
Changes are quite simple, and can be done by hand, but I supply diff files for patching, too.
I left title on the left and positioned the logo imagine on the right; Some tweaking may be necessary on logo margins in css, and logo image height must not be greater than height of banner (i.e. 180 px's).
Here are details for modifying manually:
Open style.css in your editor
under existing lines:
#header {
padding: 0;
margin: 0;
height: 180px;
background: #000033 url(img/banners/rotate.php) no-repeat 0px 0px;
position:relative;
}
add these new lines:
#logo{
/* be careful: max height of logo image : 180px (as header's height) */
/* assuming some defaults: modify margins as required */
margin-top: 30px; /* "n px" where n=(180-logo_height)/2 to have image vertically centered */
margin-right: 35px;
margin-bottom: 0px;
margin-left: 0px;
/* logo image on the right */
float: right;
padding:0;
}
#logo img{
padding:0;
margin:0;
}
save and close.
Open page.tpl.php in your editor
under existing lines:
<div id="page">
<div id="header">
add these new lines:
<?php if ($logo): ?>
<!-- logo_image -->
<div id="logo">
<a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>"> <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" id="logo" /> </a>
</div>
<!-- /logo_image -->
<?php endif; ?>
save and close.
You are done. :-)
I didn't try, but I suppose a similar approach can be done for drupal 6.x version
mau
Comment | File | Size | Author |
---|---|---|---|
marinelli5x12.page_.tpl_.php_.patch | 597 bytes | mau-it | |
marinelli5x12.style_.css_.patch | 1.06 KB | mau-it |
Comments
Comment #1
mau-it CreditAttribution: mau-it commentedComment #2
jdvc CreditAttribution: jdvc commentedAWESOME fix, works on 6.x too!
Comment #3
nikmahajan CreditAttribution: nikmahajan commentedYeah works on 6X but to make image overflow hidden, following should be put into #logo {}
overflow: hidden;
Comment #4
odox CreditAttribution: odox commentedCould not get this logo feature to work, with or without code on latest version. Can anyone help?
Comment #5
guitarma CreditAttribution: guitarma commentedI moved the Primary links to below the header, but above the secondary links. My question is: how do I add a region ABOVE the header? I want to put ad space there. Same width as the banner, but only 90-100 pixels high.
I don't have enough php experience to add the region myself, or to even know all of the files to add it to.
Can anyone help me?? Thank you so much, if so!
OOps! Just realized I posted in the wrong place - sorry, I'll move it!
Comment #6
jfmoore CreditAttribution: jfmoore commentedThanks for the fix. I'm not sure, though, what the logo should be named and where it should reside?
Comment #7
Michal1986 CreditAttribution: Michal1986 commentedwhether it works for version 5?
Where can I download themes for version 5 ??
Comment #8
sino CreditAttribution: sino commentedThanks mau! It works for Drupal 6.13.
jfmoore, no need to concern about the logo image file name, just upload it via
Home » Administer » Site building » Themes
Comment #10
bchezem CreditAttribution: bchezem commentedWhen using the Giordani sub-theme in 6.13, make these changes....Instead of using style.css ( which has been replaced by several other CSS ) use sites/all/themes/marinelli/graphics.css
Instead of the marinelli/page.tpl.php, use sites/all/themes/marinelli/giordani/page.tpl.php.
Also, the banner images in Giordani are 200px high...this is of little consequence except for centering logos.
Comment #11
garpy CreditAttribution: garpy commentedThis worked nicely. At the moment I am not getting the logo to display on the home page. Which I would like. If I find out why I will post it here. Probably something easy. If you know please kindly post here. Cheers
Comment #12
garpy CreditAttribution: garpy commentedOk so putting the same code in the page-front.tpl.php worked for getting the logo to land on the front page as well. A few nip and tucks with firebug to the css were needed as well to get the position right. I was able to put a larger than mentioned logo too which was nice.
Comment #13
mrbrowny CreditAttribution: mrbrowny commentedjust suscribing :)
Comment #14
drupal92037 CreditAttribution: drupal92037 commentedWorked for me on Drupal 6.14. Thanks!
Comment #15
Bob Stein CreditAttribution: Bob Stein commentedOutstanding. Works in Drupal 6.14. Thanks very much.
Comment #16
laxking CreditAttribution: laxking commentedworked great!
Comment #17
heinzeroth CreditAttribution: heinzeroth commentedDrupal 6.16 - Marinelli: Giordani Theme
I uploaded logo in size of 175x200px, but when viewing in header, image loads in size of 53x60px !!!
So I added a resize in:
marinelli/graphics.css
#logo img{
padding:0;
margin:0;
width: 90px;
height: 115px;
}
But image is distorted somewhat - possibly may have to resize image to this pixel size.
And my image is centered and will overlap into secondary link bar:
Is there anyway of taking the vertical center out so that image can be positioned using margins or padding???
example: www.greatlifeinsurancegroup.com/newsblog
Comment #18
AuctionTeamster CreditAttribution: AuctionTeamster commentedWorks in 6.17 ----- THANKS
Note:
If you have created a custom maintenance_page.tpl.php copy the code to the template works. Thanks again.
Comment #19
pswasey CreditAttribution: pswasey commentedI would really like to utilize a logo overlay on my banner, but this process isn't working in 7.x. Does anyone have any recommendations? Has anyone been able to do something similar in 7.x?
Thanks!
Comment #20
WoRo CreditAttribution: WoRo commentedsolution does not work in IE 7. Logo moves banner to the right/left (depends where you place logo). FF/Chrome/Safari/IE9 OK. But not in IE 7.