So this last week I have been Designing a Blogger theme as part of a larger project for my friend and ally Paul Kooiman and the process was actually really enjoyable. I was able to overcome some interesting technical hurdles, implement some fun doodads to enhance the nature of his blog and just generally outline what I think is a good approach to taking a Blogger Theme project on.
I first outlined the things we needed to accomplish:
- Had to look simple and elegant, Client provided some Blogs he liked
- Showcasing Photographic content, use jQuery and Lightbox to get a polished look
- Branding is all lowercase letters; orange, white, grey; match existing collateral
Next it was time to get a baseline and listen to some music. I grabbed the simple Blog theme, expanded the widgets in Edit HTML mode and copied the contents out to SciTE for editing. Ended up saving this file as an xml file which worked out for handing the work over to the client (Darjeeling Limited Soundtrack for most of this part).
Getting your head around the CSS in the blogger themes is a bit tricky because each blogger theme kind of makes it up as they go along. I needed to a way to easily see the changes I intended to make to the css, without the save/view process getting in the way. To solve this problem I first decided to get jQuery loaded up in the theme, and view it in the Google Chrome browser, which gives me handy developers toolset for testing CSS and JavaScript from a console.(Jamaroquai, Canned Heat)
To implement jQuery quickly in blogger put this in your blogger theme xml file and upload it.
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
With this setup it was a straight forward trial and error process of utilizing jquery console selectors, for instance: Let us imagine I want to see what on the output page is affected by changing the date-header class, in the console I type $(".date-header").css("color","#f00") which will turn any text directly beneath that class bright red. This was awesome for finding all the css I wanted to include to just clean things up. For example try the following in your console:
$("#navbar").css("display","none")
So now you know the css to remove the navbar at the top.
Implementing the lightbox and custom images was a little less straight forward but was still pretty easy to achieve. First you need to determine where you will store your remote files, we needed to load a custom favicon, graphical header, javascript file, css file and all the images that go along the with the Lightbox Plugin. Once you know where everything is going to be, ftp it, set the locations on all href, src and other attributes you need. Use the same method from importing jQuery to import any other scripts and plugins you want. Make sure you do not add script tags before the </b:skin> tag.
note: You can change the header link (image) to point at your website by replacing expr:href='data.blog.homepageURL' with href='http://YOURADDRESS' in the header widget area.
I put all my document ready script at the bottom of the file, you don't have to but it made it easier to find. Anyway that is all for this post. Happy hacking.