So in the
last iteration of theming Drupal 7 from scratch with a bare bones template we covered the page.tpl.php, the base.info file and a blank basesite.css file that did absolutely nothing for us.
As you can tell the base site is very basic with no color other than the admin panel and everything is stacked on top of each other. We are going to concentrate on adding CSS to format the site in the way that we want it at a basic (still plain) level.
I have my
basesite folder setup with these files. The files I have added since the last tutorial were the logo.png and the screenshot.png. I was initially using JPEG images for my logo and screenshot but the images would not load on the site until I changed the file over to PNG. I prefer the png format overall so this works better for me but I do not know why the JPG images were not loading.
The logo.png is the logo that will appear on your site and is required to be named logo or the php will not grab the image. Im sure that we could change the $logo to whatever else but logo is a definitive term that will help to keep larger sites organized. The same goes with the screenshot.png, this has to be labled screenshot or the admin console will not pull it up.
This is the updated page.tpl.php file to wrap the components into div tags to organize the overall layout of the site. This updated file does nothing until the basesite.css file is updated.
The basesite.css file hase evolved quite a bit. From the first site to get the content organized in a proper format that is easier on the eyes and more user intuitive.
I like to organize my Css files the best I can as I am coding them to make sure that they flow well with the site and there are cases when the previous set of Css will overwrite the new Css code if you do not use an Important flag.
The .header aligns the image to the center of the monitor and adds a 15 pixel border to the bottom of the header region. Its not much Css but its effective.
The .contentstuff is for the main content and is setup as a float so that it will sit next to the .left sidebar. I addedd padding to get the main content to space it away from the footer region.
The .leftsidebar if for the sidebar that holds the navigation pane, login , and search. This region is setup under your structure and then blocks. This is setup as a float so that it will sit to the far left. I addedd padding to get the sidebar to space away from the header region.
For the .footer I created a box to encapsulate the information that I have stored in the footer area like Who's online and what not. One thing that is really important for this region is the "clear: both;" that I added on the first line. This clears the floats from the leftsidbar and the contentstuff so that it appears in the bottom of the screen as intended.
The entire Css file is below:
The site now looks like the following image:
The site is still basic but it is starting to take shape. I will try to get the next iteration of this tutorial out this upcoming week. Maybe we will add a repeating background, link click colors and things like that. Thanks for reading.