Closed (won't fix)
Project:
Zen
Version:
6.x-2.0
Component:
layout.css
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Jun 2009 at 17:48 UTC
Updated:
21 Aug 2013 at 15:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
luco commentedwell, I figured this one out.
so here's the needed sticky_footer.tpl.php (changed so as the #footer DIV is outside the #page DIV) and a very useful sticky_footer.css.
to use it, simply copy sticky_footer.tpl.php as page.tpl.php and sticky_footer.css (without changing its name) into your zen subtheme folder. don't change the css filename, though, only the tpl.php filename.
find in your zen subtheme's .info file the line that reads:
stylesheets[print][] = print.css
and above it, write:
stylesheets[all][] = sticky_footer.css
reload your theme's registry by visiting admin/build/modules. voilà!
Comment #2
luco commentedforgot the attachment...
Comment #3
luco commentedwell, I'll be darned. I have to reply again in order to attach the file.
Comment #4
scottrigby@luco: great idea :)
It would have better success though if supplied as a patch.
Looking forward to seeing where this goes
Comment #5
luco commentedsorry. I can't create patches. the whole concept just goes right through me :)
if anyone can / has time to create a patch I'll happily talk to them.
Comment #6
KrisBulman commentedI've tried this, and it doesn't work.
Comment #7
luco commentedand by "doesn't work" you mean... ?
let's bounce some ideas, see what we can come up with.
Comment #8
luco commentedhey all,
I'm trying to add a sticky-footer.css file to Zen version 6.x-2.0-beta1, but it simply won't work. I went to zen.info, added "stylesheets[all][] = css/sticky-footer.css", cleared the caches... but nothing. it doesn't show up in the code.
I'd like to add a custom CSS file so that I can better study this sticky footer situation against the latest Zen realease. and then perhaps create a patch for others ;)
so any help is greatly appreciated.
cheers,
Luciano
Comment #9
KrisBulman commentedany luck with this Luciano?
by doesn't work, i mean the footer simply does not stick! :P
I've attempted to apply the footer css directly to the themes css files as well as move the page.tpl.php code around according to the structure here:
http://www.cssstickyfooter.com/using-sticky-footer-code.html
and the footer still does not stick. Has anyone successfully created a subtheme using these sticky footers? link?
Comment #10
luco commentedKrisBulman, I've already released a few projects with this solution. my portfolio for example: www.luco.ws. I even succeeded in putting the footer inside rounded corners DIVs ;D if you navigate to www.luco.ws/user you'll see it sticks.
I've manually tuned the current Zen version to suit my needs, but sure enough I need to place this code for everyone - or else it's pointless.
if you want I can share with you the current Zen version I have with the sticky footer.
Comment #11
KrisBulman commentedI would most definitely appreciate it if you provided some insight into your solution!
Comment #12
luco commentedoh, ok! here you go: http://www.cssstickyfooter.com
it's all from this website. I just adapted so that it'd work with Zen.
Comment #13
KrisBulman commenteduh yeah, i guessed that and i tried (and failed) doing the same.
i was hoping for your page.tpl.php and your related css, but i guess I will have to pull it out of your site using firebug/webdev
Comment #14
luco commentedhey! no problem, man. I hadn't understood what you meant.
I'll zip my theme files and send to your email, ok?
cheers
Comment #15
KrisBulman commentedsure thing, much appreciated. If this works it could be re-contributed as a subtheme
email
kris [at] bulman.ca
Comment #16
KrisBulman commentedyou can just post the tpl & css files here if it's not too much trouble, thanks!
Comment #17
luco commentedsorry man! actually I've been just CRAZY with work so I was unable to send you the stuff. it's there now.
Comment #18
luco commentedhey there,
I've successfully edited pages.css on Zen 2.0 to add sticky footer functionality. details here and here.
it's working on opera, firefox and chrome, as well as IE 7 & 8.
doesn't work on IE 6 but TBPH that browser's (gladly) not the majority anymore :)
anyway can someone test and commit?
cheers,
Luciano
Comment #19
luco commentedopps. links in #header aren't clickable unless you add
z-index: 1to it. my bad.Comment #20
KrisBulman commentedI was able to create a vanilla subtheme using the sticky footer method, but since Zen1 is going the way of the dogs, I saw no reason to post it.
I have yet to attempt a Zen2 sticky footer.
Comment #21
luco commented@KrisBulman, have you tried the file I attached? it seemed to work on all places but IE 6, which isn't a bad thing in my opinion. ;)
also, "the way of the dogs"? what does it mean?
cheers
Comment #22
luco commentedanother slip: it seems that you have to turno off
overflow:auto;in DIV #main to prevent the logo in #header from interfering with it. go figure.Comment #23
luco commentedanother thing: the DIV #main should have
min-height: 0px;for IE7. I'm slowly building this on my own... hope the maintainers add it to a forthcoming release, at least ;)Comment #24
bverc commentedsubscribe
Comment #25
nordicmaterial commentedI successfully implemented a sticky footer inside my Zen2 theme (http://www.crosstalks.net/smartfooter).
Method uses CSS from the article by Stever ( http://www.cssstickyfooter.com/ ).
Here's how to proceed:
1. Modify templates/page.tpl.php .
By default, the Zen theme will put #footer inside the #page-wrapper. You need to get it OUT of there.
The footer zone should be the very last element before your tag.
This will make the last lines of page.tpl.php look like this:
2. Add the next lines of CSS to one of your main .css files (pages.css for example).
Footer height can be adapted of course, as long as you change it in all 3 elements.
Comment #26
luco commented@nordicmaterial did you see the CSS (and fixes) I posted?
with it, you don't have to make any changes to TPLs. ;]
cheers
Comment #27
barrapontoI've turned the CSS fix from #18 into a patch for zen, and also created a footer.css file. You can use either fix (apply the patch, or add the footer.css file to yoursubtheme.info).
also, i have added it to my zen compass plugin, check it out at https://bitbucket.org/barraponto/compass-drupal-plugin/raw/e269a6ecd566/...
Comment #28
barrapontooh, I hope it gets reviewed soon.
btw, I don't actually expect the patch to be applied as is to Zen. Instead, I'd put it into a separate file, and have it declared on STARTERKIT.info, although commented out. See this new patch.
Comment #29
barrapontoRe-rolling patch with new file.
Comment #30
luco commented@barraponto e aí rapá, beleza?
ok now in plain English: glad you liked the CSS. hope they commit your patch. I would have patched myself, but I don't know how to yet. so thanks!
happy 2011 :]
Comment #31
new_B commentedThank you so much! It was extremely helpful. (I was "banging my head" on this one.) #29 worked for me (in IE 7, Firefox, Opera, and Google Chrome).
Comment #32
new_B commentedI just tested with IE6, which doesn't work. The following fixes it:
In footer.css, change
to
Comment #33
luco commented@new_B great!
but it's better to create a separate CSS file for that unfriendly browser, and call it using conditional comments. CSS hacks keep the code from passing W3C's validators, and that makes people sad :(
other than that, good job. thanks :]
Comment #34
barrapontofooter.css is an optional css (it is not enabled by default in the patched .info).
if we add the ie6-only code to a different file, we must add another optional ie-exclusive css file (can't add to default ie6-only file).
Comment #35
luco commented@barraponto I understand. two separate CSS files for IE, or the optional CSS file with hacks. is there a coding standard for that?
personally I don't think any developer would be encouraged to hack CSS standards, but it's an optional file, so I'm uncertain.
plus I'm more of a redshirt :]
Comment #36
new_B commentedThanks for the info--I really appreciate it.
I just noticed today though that the footer sticks to the bottom but there is now a big whitespace gap between the content area and the footer on shorter content pages. Have you encountered this issue as well and/or have any suggestions/ideas on how to fix it?
Thanks again.
Comment #37
luco commented@new_B yeah, that's a byproduct of sticky footers in pages with little content. but if the footer didn't stick, you'd still have a big whitespace.
some designers resolve this by creating footers of gargantuan proportions. me, I prefer creating pages with relevant content whenever possible ;]
Comment #38
new_B commentedThanks, luco, for the info & your help.
Just to confirm if we're both on the same "page", as I might have not described the issue properly. When I mean big whitespace gap, there is a lot of whitespace between the content and footer, pushing the footer beyond the visible area on the screen. It introduces a scroll bar requiring the user to scroll down to see the footer. It seems that the footer could be higher up and viewable without scrolling down. Is that a byproduct of the sticky footer code applied?
Thanks again--much appreciated.
Comment #39
n8tronIn order to remove the vertical scroll bar and white space, I had to put #header div inside of the #main div in page.tpl.php so the height worked correctly. I'm using D7 and 7.x-3.x-dev tho.
Comment #40
barraponto@n8tron: i haven't tested this on d7
@new_B: IE? which browser are you using?
Comment #41
new_B commented@n8tron: Thanks. I moved the #header div as suggested and it worked. I'm using D6 and Zen 6.x-2.0.
@barraponto: I've tested with IE6 and IE7. Thanks.
Comment #42
luco commented@new_B oh, I see. what I did was change CSS sizes around until it worked ;] AFAIK there must be a size declaration for sticky footers to work - and that changes from site to site.
Comment #43
new_B commented@luco Sorry, I don't quite get what you mean. Can you please clarify?
Also, is the method that n8tron suggested okay too?
Thanks--much appreciated.
Comment #44
luco commentedhey @new_B :]
what I meant is that you have to specify how tall your footer is going to be. the sticky footer technique won't work unless you define, for example, that your footer's 100px tall. that way, you tell the page to have a negative 100px margin and everything fits.
also, regarding n8tron's suggestion I managed to have a sticky footer without compromising the template structure. what I did was that the negative margin and the footer height weren't exactly the same. you have to fiddle a little till it's good to go.
cheers
Comment #45
themusician commentedI wanted to let everyone know that #25 above works great on Zen 7.x-3.1 as well. A great addition to the Zen framework.
Comment #46
zeppelinstudios commented@theMusician
Any chance you could post your page.tpl.php fix for Zen 7.x-3.1? I can't seem to make this work... Apparently the code changed a lot since nordicmaterials post :)
Thanks!
Comment #47
themusician commentedMy footer code is a bit different. I needed three editable sections. I hope this helps. #25 worked great for me.
My CSS or #25 from above
Comment #48
aniebel commented#25 seems to work great for FF 9.01 and IE 9 but not Chrome 16.0.912.77
I find that odd. I haven't tested my particular site on any other versions of IE.
Comment #49
johnalbinThe 6.x-2.x branch is in bug-fix only mode.
Comment #50
ymakux commentedhttp://www.drupalcoder.com/blog/cross-browser-sticky-footer-with-fluid-h...
Zen 7.x So far works for me