Friday, November 2, 2012

A new? sticky CSS footer....


Just trying to re-invent the wheel here...something I wrote this morning.
So far I have tested it in IE 9 (Win 7), Chrome, Chromium (Linux Mint), Midori (Mint), Opera (Mint and Win 7), Firefox 11 & 18(Mint and Win 7). I even tested it with IE 7(Win) and Safari 5.1(OSX).


----html-----                                                                                                                                 
                                                                                                                  
<div class="wrapper">
    <div class="header">Menu...or something </div>
        <div class="main_content"> Other stuff</div>
/div>

<div class="footer">Lorem Ipsum </div>     

The CSS is just as simple:

----css----                                
              
    html, body {
    height: 100%;
    margin:0;
    padding:0;
    }

.wrapper{
    min-height:100%;
    background-color:#00CC33;
    }

.header{
    background-color:#0099FF;
    }


.footer {
    background-color:#999999;
    height:50px;
    position:relative;
    margin-top:-50px;
    }



The background colors are there just for reference reasons.
I tried alot of the other solutions out there and it seems that all of the prominent ones were written in 2003, and they suck. This is the simplest, most elegant solution that I have seen....That is until we try it with a page that has more vertical content that needs to be scrolled. This screws everything up....So my solution was to give the wrapper a value of  "margin-bottom:50px;"  The problem then is the browser will ignore the "min-height:100%;"  and it sets the Wrapper  height to whatever arbitrary value it desires. 
How to overcome that behavior?
 

Setting up a new Drupal 7 installation....

These are a couple problems that I ran into today while setting up my latest Drupal installation....I normally run a turnkey setup from my webhost but I decided to go ahead and use an old lap top as a server in my office just for dev purposes.

Here are the hurdles that I ran into and what I did, really this is gleaned from reading other people's blogs, posts, etc....but there are a couple bits that some leave out that might be useful to someone. Or at least useful to me when I do this again in a year and forget some bit along the way.


1. MYSQL login
         Reset Password
                 Server rejected send messages (Ubuntu requires all admin cmds to be sent as SUDO)


2. Settings.php file permissions
         CHMOD didn't work as 775, the owner of the file needs to be the web server itself which in my case (lamp stack, Ubuntu 12.04) is www-data. 775 with CHOWN as www-data works.





--------------------------------------------------------------------------------------------------------------


Drupal 7 - Post Installation:


Setting relative file paths for uploads found in "Home » Administration » Configuration » Media" for the Private directory results in Drupal attempting to create a directory if one does not exist. This would be fine, but the directory does exist. I have the private directory outside the directory structure that Drupal is installed in. Ok great you say, that is of course how you are supposed to do it for security reasons...However when I put the double dot operator to move up the directory structure as follows:

 It fails to create the private location further up the directory structure....so when I go and manually create the directory in linux and CHOWN it over to "www-data" (the webserver's username according to the server.) And set it to CHMOD 775 it still fails to work. The relative file path settings seem to fail. Anyone with any insight into this?