February 13, 2008

The easy way to make a great blog header!

In yesterday's post, I wrote about what makes a great blog header. As I'm sure many of you will agree, a great blog header doesn't only include your blog's title and logo. Visitors need to know what your blog is about (branding) and how easily they will be able to find the information they need (navigation, and possibly search elements).

So in this installment of the blogger template design series, I'm going to show you a quick and easy way for you to add more than just your header image to your Blogger blog: adding extra sections for widgets, in which you can place anything you want!

If you take a look at the Blogger Template Design blog now, you'll see the bare bones of a header beginning to take shape. The title and description for this blog are now featured in the left-hand section, while on the right you can find a search box, and a simple navigation bar:

The search box and navigation links are actually widgets which can be edited through the layouts section, rather than being built into the template itself. This is by far the easiest way to change elements of the header section, and it's really easy to install this in your own blog template!

How to add more elements to your header section

In this tutorial, there are only three essential steps needed to add these extra elements to your own blog:

  1. Copy and paste a section of code in the header section of the template.
  2. Add some styling code to the CSS portion of the template
  3. And finally...
  4. Add some widgets to your newly created widget sections!

Trust me when I tell you that this is a really easy hack. You can be up and running with a new, more interactive header in no time at all, and once the basic structure is in place, you can begin styling each section to best suit your needs.

Step by step instructions

  1. Go to Template>Edit HTML in your Blogger dashboard, and find this section of code:
    <div id='header-wrapper'>
    <b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
    <b:widget id='Header1' locked='true' title='Your blog title will appear here (Header)' type='Header'/>
    </b:section>
    </div>
    Highlight this entire section of code, and replace it with this instead:
    <div id='header-wrapper'>
    <b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
    <b:widget id='Header1' locked='true' title='Blogger template Design Series (Header)' type='Header'/>
    </b:section>
    <div id='header-right'>
    <b:section class='header' id='header-right-top' showaddelement='yes'>
    </b:section>
    </div>
    <div id='header-right-bottom'>
    <b:section class='header' id='header-right-bottom-section' showaddelement='yes'>
    </b:section>
    </div>
    </div>
  2. Next we need to change some of the style in the <b:skin> section. So find this entire section of code:
    #header-wrapper {
    border: 1px solid #000000;
    margin:0 auto 10px;
    border:1px solid $bordercolor;
    clear: both;
    word-wrap: break-word;
    overflow: hidden;
    }

    #header-inner {
    background-position: center;
    margin-left: auto;
    margin-right: auto;
    }

    #header {
    margin: 5px;
    border: 1px solid $bordercolor;
    text-align: center;
    color:$pagetitlecolor;
    }
    Note: the code which appears in your own template may have slightly different styling attributes to the example above. The important thing here is to replace the #header-wrapper, #header-inner and #header sections, and add some extra styling code.

    Once you have found this section, highlight it and replace it with the following section of code:
    #header-wrapper {
    width: 950px;
    border: 1px solid #000000;
    margin:0 auto 10px;
    border:1px solid $bordercolor;
    clear: both;
    word-wrap: break-word;
    overflow: hidden;
    }

    #header-inner {
    background-position: center;
    margin-left: auto;
    margin-right: auto;
    }

    #header {
    width: 500px;
    float: left;
    margin: 5px;
    border: 1px solid $bordercolor;
    text-align: center;
    color:$pagetitlecolor;
    }

    #header-right {
    width: 400px;
    float: right;
    border: 1px solid $bordercolor;
    color: $pagetitlecolor;
    margin: 5px;
    }
    #header-right-top {
    padding: 0 5px 10px;
    }

    #header-right-bottom-section {
    padding: 0 5px 10px;
    }

    #header-right ul {
    margin: 0;
    padding: 5px;
    }

    #header-right ul li {
    display: inline;
    padding: 5px;
    }

    #header-right-bottom {
    width: 400px;
    float: right;
    border: 1px solid $bordercolor;
    color: $pagetitlecolor;
    margin: 5px;
    }

    #header-right-bottom ul {
    margin: 0;
    padding: 5px;
    }

    #header-right-bottom ul li {
    display: inline;
    padding: 5px;
    }
    Note: if your own blog template is narrower than 950px, you may want to make some alterations to the styling code above. Change the width of the #header-wrapper to match the width of your outer-wrapper, so that it will not disrupt the overall width of your blog. You may also want to lessen the widths of the #header section, and the #header-right and #header-right-bottom sections too.

    If you preview your template you will see that the title and description are now aligned to the left, with space on the right for you to add your new widgets. So save your template, and let's add some widgets to these new sections!
  3. Adding widgets to these new sections is the easiest part of this tutorial. Simply go to Template>Page Elements and add your widgets in the new sections which have appeared beside your header!

    Both of these sections now have styling for list items, so if you want to add a navigation bar, choose to add a "Links List" page element. Add your links as required and save. When you preview your template, you'll see that this display inline (horizontally) rather than in a long list.

    To add a search box to your header, you could either choose to add a Google Custom search widget, or use a simple blog search widget instead.

Width these extra widget sections in place, there are endless possibilities for what you may add to your header section! I used a search box and navigation links as an example, but you could easily substitute these for a description, feed links or anything else you choose instead.

Your blog logo/custom header image

As before, you can still add your custom logo or header image to the header widget. This will be resized to the new width of your header section (in the example above, this is 500px wide), so for best results you should upload an image of the same size.

If your image is wider than this, you should check the "Shrink to fit" box inside the widget editing box to ensure the header doesn't overshadow the other widgets on the page.

Coming soon...

The next two installments of the Blogger Template Design series will focus on styling your new header elements:

  • Creating a more interesting search box
  • Adding style and icons to the navigation links

If you'd like to see the progress of this series to date, you could check out the demonstration blog to see the what we have accomplished, along with links to all previous tutorials in this series.

To keep up to date with this series, be sure to subscribe to the feed or sign up for email updates!

As always, your comments and opinions are much appreciated. I'd love to know what you think of this series so far!



View blog reactions


Related Posts by Categories



Post a Comment 20 Comments:

13 February 2008 23:22 Mattheous said...

I can't seem to paste the first section of code that you need correctly.

When I do, it says that the HTML is malformed, and that the body tag has to be closed by a body tag. Could you help?

13 February 2008 23:37 Amanda said...

Hello Mattheous,

You may need to check that you've highlighted the correct section in your template, and also that you've copied the code correctly.

I've just checked the code thoroughly to ensure there are no mistakes there, and everything seems to work okay. If need be, I could send you the code as a text file so you can simply copy and paste this into your template. Just send me an email to amanda[at]bloggerbuster[dot]com and I'll do my best to help.

13 February 2008 23:36

14 February 2008 00:15 Mattheous said...

I think the problem is I don't seem to have a header-wrapper section in my template. I'm using a Scribe template--could that be the problem?

14 February 2008 20:10 Scott Boutwell said...

Hi:

I incorporated the edits but received an error message that a variable was used but not defined (bordercolor). Am trying to edit the Rounders template. Thanks.

16 February 2008 12:50 Amanda said...

For Mattheous:

I'm just experimenting with the Scribe template now. I'll email you the details as soon as I've figured out the correct code to use.

For Scott Boutwell: in the Rounders template, the border color is defined as borderColor (note the capital C).

If you can edit the code so that all instances of bordercolor (with a lowercase c) are changed to borderColor instead, this should help solve the problem.

Alternatively, you could delete the border properties altogether, and the code will still work for you.

Hope this helps!

Best wishes,

Amanda

16 February 2008 19:03 Mattheous said...

Ok, thank you!

16 February 2008 19:10 Scott Boutwell said...

Hi Amanda:

Thanks; I did figure out yesterday that I needed to capitalize the "C" in borderColor....

I have used a bunch of your hacks to customize my site, including incorporating a better header...great work; thanks very much.

My blog: www.scottboutwell.blogspot.com

(I have 'de-rounded' the Rounders template....)

17 February 2008 16:44 David said...

Amanda,

Interesting post series. I will have to refer back to it for ideas.

For now, am still struggling to add navigation options to my Classic blogger template. Can you tell me how the instuctions in your navigation buttons post would look in my classic template?

http://www.bloggerbuster.com/2007/10/create-navigation-buttons-for-your-blog.html

Thanks.

17 February 2008 22:36 Bard Girl said...

I'm going to give this a try but I'm a complete moron when it comes to the mystery that is HTLM.

20 February 2008 22:16 Mattheous said...

Do you have any tips on making a really great image for your header? Right now working on a new one and I can only find a good font. I want a good background, too, but none of the images I like are the right size.

22 February 2008 00:05 Amanda said...

For David:

The code in the post you referenced would essentially be the same for a Classic template. There are only two differences.

Firstly, rather than add the style code to the <b:skin> portion, you would need to add this just before the closing </style> tag in your classic template.

For the actual code used to display the buttons, you need to add this directly in your template HTML, in the place where you would like the navigation links to appear.

Hope this will help, but feel free to email me if you need more help with this one!

Best wishes,

Amanda

25 February 2008 05:47 Anonymous said...

Hey Amanda,
I just discovered your site and I love it! Is there any way to create/ move the navigation bar to go under my header? I didn't know if you have a tutorial or had explained that earlier.
thanks
reina

07 March 2008 14:12 Leslie said...

Hi Amanda!

You've inspired me to give all this hacking stuff a try! :) Thanks!

Anyhow, I posted the code for the header and then noticed that, yes, the banner was too wide so I did what you suggested and edited the header wrapper size to be the same as the outer wrapper. NOW, the new sections are not on the right side of the banner; they're sort of underneath and to the right which leaves the banner section kind of in the upper left, which looks kind of funky.

Advice? Thanks, Leslie
leslieland.blogspot.com

13 March 2008 10:49 Pranav said...

Hi Amanda,

Thanks for the excellent article. It really made things pretty easy for me. Your article still assumes some knowledge of CSS usage.

Pranav

19 March 2008 04:55 Christine said...

Hi Amanda,
Thanks for the excellent article. I really want to try your hack and create a great header for my blog. But my blog has got a menu bar that I’d like to keep it. How can I do it then?
Here’s my blog:
http://food-recipes-christine.blogspot.com/

20 March 2008 19:34 Dav7 said...

hi Amanda

once again I made another costumation to my blog following your tips :)

now I have one doubt:

is there any way to make the #header-right align on the bottom off the header instead the top?

f you see my buxmaking.blogspot.com I had a search widget, but I would prefer to see on the bottom ;)


I will be waiting for your help as always :D

23 May 2008 16:46 PhillyChief said...

I was wondering how you can stop the title of the header or any widget from displaying without globally turning off title display for everything in the /* Headings section.

09 July 2008 04:56 JOSEVI said...

Hello
is great how good is this page, but i have a problem with the header, when i change it the page says that there is a problem with bordercolor, and pagetitlecolor.
what i can do?
im using a blogger template 3 colum

19 July 2008 23:32 Jana said...

How would I put the navigation buttons under my header similiar to your red line across your blog? Love your site!

20 July 2008 12:21 sumit said...

ist one not working , pls chech ur self
thankz

Post a Comment