I wonder if someone knows how to add an extra container in the header?
In my 'header', I have added a background colour via background-image: #color; in the #section-header. Looks fine. And probably the wrong way to go about it. It just demonstrates my inferior skillset in CSS.
I need a container that includes all zones on the #section-header, but is no wider than the columns section. In my case 12-column. The container should float under the zones. The result should be that I can add an image and position it, and all elements in the other zones; user, branding, menu and header, should float on top.
How can I do that? I might add I have trawled all over the place to find is described before posting here.
As a bonus question: I figure I can apply the same learning to other sections/regions, as necessary?
I'd love to contribute back some day to other beginners. For now, I'm the student. Thanx!
- Christian
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Omega-Theme-Section-Header-with-extra-container-and-image.png | 7.86 KB | s@ilor |
Comments
Comment #1
Pratheep commentedI'm quite lost when you say you want the container to "includes all zones" in the #section-header AND "float under the zones". Are both statements referring to the same zones? Its difficult to imagine what you want. Could you make a quick sketch and show how you want the container to be?
Comment #2
s@ilor commentedYes, I guess it must be quite confusing. Let me clear that up:
What confuses me, is the separation in linear zones, where all elements are contained within each zone. And the naming convention! Anyway, what I try to accomplish, is to have one sitewide header (#section-header?) with a background colour. I want to add an image (imagine a watermark or structure image with low density) to float on that background colour.
On top of it all comes all the other elements such as logo, sitename, menu, search-field etc. Whatever is necessary to have in that section.
The background colour I have done like this:
#section-header {background-color: #70bd26;
background-image: -moz-linear-gradient(top, #739705 0%, #70bd26 100%);
background-image: -ms-linear-gradient(top, #739705 0%, #70bd26 100%);
background-image: -o-linear-gradient(top, #739705 0%, #70bd26 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #739705), color-stop(1, #70bd26));
background-image: -webkit-linear-gradient(top, #739705 0%, #70bd26 100%);
background-image: linear-gradient(top, #739705 0%, #70bd26 100%);
}
Now, adding an image as background-image: url ... doesn't exactly play nice with the above. So I figure I need an extra container to separate things a bit.
Hope that helps.
Thanks,
- Christian
Comment #3
RobNL commentedI subscribe to this. I also need an extra wrapper div in #section-header. For example #section-header-inner.
In Layout configuration --> Zone and region configuration it is possible to add a wrapper class in the zones, but not in the sections. Or do I forget something here?
Thanks,
Rob
Comment #4
fubhy commenteduse section--header.tpl.php in your theme's template folder to add another wrapper. Copy section.tpl.php from the alpha theme for a start.
Comment #5
s@ilor commentedThat doesn't make enough sense to me. There must be more to it, than just copy one to the other.
I appreciate your help, Sebastian, it's only that I'm a beginner. I need more to go on. It's a fairly complex learning process already. I'm really fascinated with the possibilities in this theme, I have just not grasped all of it yet.
I have been trying to pick up as much as possible from available documentation before I posted here. As said, I hope I can give back to others one day.
Thanks,
- Christian
Comment #6
fubhy commentedCopy the template to your theme folder (place it in YOURTHEME/templates), then edit it according to your needs. Omega will use your version of the template after clearing the caches.
Comment #7
RobNL commentedThanks fubhy!
In my templates folder I added the file section--header.tpl.php with the following content (I added lines 2 and 4):
That did the trick for me.
Comment #8
fubhy commentedComment #9
s@ilor commentedThank you both. Not sure I got it right, though.
I did as above.
Should I then be able to use:
#section-header .section-header-inner {
background-image: url(../../../../default/files/watermark-header.png);
background-repeat: no-repeat;
float: left;
margin: 300px 0 0px 0px;
padding-bottom: 10px;
}
??
Nothing happens,
Comment #10
RobNL commented@Drunkensailor if you implemented my little contribution you should use #section-header-inner instead of .section-header-inner. And #section-header isn't necessary.
Comment #11
s@ilor commentedWell, I tried that already. It blew the entire header section. Only a few elements left, menu gone. The preface-zone marches right up into what was suppose to be my header.
If I omit the # from section-header-inner, the site is restored.
So, something is not quite as it should be.
Very likely(?) it has to do with the way I added the background color/image?
- Christian
Edit: I'm certain now, it's the PHP part, I have wrong. But I cannot see how.
Per instruction, I have copied the 'section--header.tpl.php' to my themes templates folder. Then I have edited it to have:
and nothing else.
The result is that when I insert '#section-header-inner' in my CSS, the header disappears.
What have I overlooked in your instructions?
Comment #12
Pratheep commentedWith "margin: 300px 0 0px 0px;" are you trying to place the image 300px from the top? Then this should do;
The image will be centered in the #section-header-inner, 300px from the top.
There is no need to float the div.
Comment #13
s@ilor commentedThank you so much, Pratheep, for pointing that out. I completely failed to see that. Copied it from some other css, and thought it would float the image 300px from left. Just to see it affect. Never mind the 300px. Just a number
Anyway, things are looking much more promising now. Image is there looking nice. I only have to figure out which values to use, to position it, and this seems to work:
Issue closed from my point of view.
Comment #14
s@ilor commented