Wednesday, March 2, 2011

Add A Widget (Menu) Above The Title (Header) In Blogger

Browsing around websites you may notice that the vast majority have a small menu bar at the very top of the page. This sometimes adds consistent functionality to the site on all pages, or like the one on this blog adds basic quick links and some info. Adding this is a simple way to make your blog look more professional, or just to add some fanciness.


In order to do this you need to go into the HTML and edit some of the code to provide the ability to add widgets to this section in the Page Elements area.

1. First, in Blogger go to the Design View and click on Edit HTML. As always, download the full template to keep a backup before you make any changes.

Then do a search and find the following code (hint: I found that the instances of the search term – ‘Header’ – only occur here so you may be able to search for just this):

<div class='region-inner header-inner'>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
<b:widget id='Header1' locked='true' title='Bottom Left (Header)' type='Header'>

2. Here you can see that maxwidgets is set to just 1, showaddelement is set to no, and locked is set to true. Change the maxwidgets to a higher number (I used 3) to allow more widgets to be added. Change the showaddelement to yes to allow for the add widget link to be selected. Finally, change the locked attribute to false to allow you to move the default position of the header. You should now be left with the following code:

<div class='region-inner header-inner'>
<b:section class='header' id='header' maxwidgets='3' showaddelement='yes'>
<b:widget id='Header1' locked='false' title='Bottom Left (Header)' type='Header'>

3. Now save the template and go back to the Page Elements area in the Design section of the Blogger Dashboard. You should now have the ability to add widgets to this section! You can add anything you want here but my advice is to keep it simple.

6 comments:

  1. Nice, but unfortunately if you have an existing formatted tabbed menu bar and move it above the header it seems to lose all the tabs, and appears as a vertical menu. Is there a way round that?

    ReplyDelete
  2. Sorry, but I have no idea! I have only used it when building new menus from scratch...

    ReplyDelete
  3. superb design.. like the color. blackle orange saving energy..

    ReplyDelete
  4. Thanks for providing such a great article, it was excellent and very informative.
    as a first time visitor to your blog I am very impressed.
    website design

    ReplyDelete
  5. In reply to the menu bar changing from tabs to a vertical list when moved above the header, I noticed this change a month or so ago when Google updated their Pages feature. It's annoying. This tutorial used to work prior to that.

    ReplyDelete
  6. Did this on my blog!! It works! Thanks so much!!! :)

    ReplyDelete