Whist upgrading one of my sites from D6 to D7, I noticed the main content area (#wrap_center) was not sizing properly.
The CSS was being applied as though both sidebars were active. A bit of testing revealed that the class ".both_sides" was being applied to the body element, regardless of whether the left, right, or no sidebars were used.
I eventually traced the problem to where the body element is printed in the html.tpl.php template. Although the get_sidebar_state() function seems to work correctly elsewhere, in html.tpl.php $page['sidebar_first'] always evaluates to true (the same goes for 'sidebar_last' and 'right_dark').
I have attached a patch file which fixes this error.
The patch removes the extra classes from the body element in the html.tpl.php file and adds the admire_grunge_preprocess_html() function to the template.php.
The preprocess function adds the 'mainbody' and the correct sidebar state class to the classes_array variable to be expanded when the body is rendered.
I hope this is useful to somebody. Although there doesn't seem to be much activity around this project.
Comment | File | Size | Author |
---|---|---|---|
#4 | template.txt | 4.08 KB | Goliathsbane |
#4 | html.tpl_.txt | 1.01 KB | Goliathsbane |
admire_grunge-content-area-sizing.patch | 1.45 KB | Rijidij |
Comments
Comment #1
alancsilver CreditAttribution: alancsilver commentedThanks. That was very helpful....
Comment #2
Rustyjedi CreditAttribution: Rustyjedi commentedGreetings :)
How I apply this pathc? Some advice to the beginner please? :)
Rusty
Comment #3
Rijidij CreditAttribution: Rijidij commentedYou can find the official documentation on applying patches here
As this is not an "official" patch, I would suggest you install it locally, i.e. follow the instructions beginning with the line:
There are also directions for reversing the patch.
But if it all goes horribly wrong, you can just delete and re-install the theme.
HTH
Comment #4
Goliathsbane CreditAttribution: Goliathsbane commentedThis worked for me, though I just made the amends to the files directly (after a backup).
Files included - just rename the .txt to .php
Comment #5
kenorb CreditAttribution: kenorb commented