Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm sure this needs a lot of work, but here is a first try.
Comment | File | Size | Author |
---|---|---|---|
#6 | 519782-6-page_bottom.patch | 5.06 KB | tic2000 |
#6 | 519782-6-page_bottom_test.txt | 1 KB | tic2000 |
make-hook-footer-use-rendarable-arrays.patch | 3.52 KB | tic2000 | |
Comments
Comment #1
Gábor HojtsyHaving a hook specific to altering a tiny bit of the page output (hook_footer_alter()) sounds ridiculous. I'd rather see modules add the footer via page_alter() to page['closure'] and then require the themes to output closure from there.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedi think modules can just populate a footer region during hook_page_alter() .... agreed that there is no need for any special alter function here, nor for drupal_render_footer(). let drupal_render_page() do its thing.
Comment #3
Gábor Hojtsyhttp://drupal.org/node/511284#comment-1813776 would also support this idea with standard tools like hook_page_alter() and standard time rendering, with all the other block regions.
Comment #4
tic2000 CreditAttribution: tic2000 commentedIf it works for something else than regions then is great. I'll modify the patch to change $closure to $html_bottom and remove hook_footer for good.
Comment #5
tic2000 CreditAttribution: tic2000 commentedI changed my mind, I'll let the toolbar patch to take care of this, or if it doesn't I'll do it in the html.tpl.php patch.
Comment #6
tic2000 CreditAttribution: tic2000 commentedI see that #469242: Move <head> outside page.tpl.php it's in "lets discuss this" phase and I would not make $closure a region there anyway so I reopen this with a new patch.
This patch does the following:
1. Change $closure to $page_bottom.
2. Makes page_bottom a system hidden region.
3. Removes hook_footer because we will now use hook_page_alter to add/change content.
4. Because of 3 also removes theme_closure function which is no longer used.
5. Now drupal_get_js('footer') is called inside process_page and not preprocess_page which solves the bug reported in #510108: Call theme closure function in process_page, not preprocess_page and will make the tests I provide in #522782: Test #attached pass.
The patch in txt format is just for testing purpose. It moves the toolbar in page_bottom and adds the javascript in 'footer' scope.
Comment #7
tic2000 CreditAttribution: tic2000 commentedComment #8
moshe weitzman CreditAttribution: moshe weitzman commentedlooks like a solid cleanup to me. lets await some more feedback then i will rtbc.
Comment #9
catchLooks great to me too. Do we need to add a note about this to the docs for hook_page_alter() or just let the upgrade guide cover this particular case?
Comment #10
tic2000 CreditAttribution: tic2000 commentedI think the documentation should describe what the function does, not what it replaces. So I would say the upgrade guide should cover it.
Comment #11
catchSounds sensible to me. RTBC.
Comment #12
Dries CreditAttribution: Dries commentedNice clean-up. Thanks!
Comment #13
Gábor HojtsyNeeds update docs.
Comment #14
Gábor HojtsyMake sure to mention that themes are now required to have a page_bottom region to avoid notices like screenshot at http://drupal.org/node/484860#comment-1861274
Comment #15
tic2000 CreditAttribution: tic2000 commentedI would happily do this if you want them in Romanian. If I do it in English you would need then an English to English translation. :)
Comment #16
Gábor HojtsyAdded this doc at http://drupal.org/update/modules/6/7#hook_footer:
Still needs docs in the theme area, doing that too.
Comment #17
Gábor HojtsyUhm, a bit too much copy-paste there. Fixed D7 code to:
Comment #18
Gábor HojtsyAdded this to the theme update docs at http://drupal.org/update/theme/6/7#closure
Still needs work because I found some issues in the default page.tpl.php which I'm going to submit a follow up patch.
Comment #19
Gábor HojtsyActually, opened #534414: Fix missing docs and consistency issues with $page_top and $page_bottom as a follow up, since $page_bottom was never documented (but $closure is still documented) in page.tpl.php and its markup is not consistent with $page_top.
Comment #21
hass CreditAttribution: hass commentedRemoved, I should not open so many windows...