Putting an Image Into the Header



The image above is created from 6 different small images, but I took a snapshot of this image to create a single gif file for my header.

You would think that adding an image to the header would be easy enough, but as with most changes in Movable Type 4, it’s confusing to know where to put the code for any changes you want to make. I tried inserting the code directly into the stylesheet to begin with here, but the image didn’t display and the whole header formatting was thrown out. After lots of trial and error I decided the best place to insert the image was in the header template module.

Look for the following code:


<MTIf name="main_index">
<h1 id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2 id="header-description"><$MTBlogDescription$></h2>
<MTElse>
<div id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></div>
<div id="header-description"><$MTBlogDescription$></div>
</MTIf>

And replace with this code, pointing to your header image:


<MTIf name="main_index">
<img src="http://www.yoursite.com/blog/images/image.gif" alt="" style="float:left; padding-right:10px;"><h1 id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2 id="header-description"><$MTBlogDescription$></h2>
<MTElse>
<img src="http://www.yoursite.com/blog/images/image.gif" alt="" style="float:left; padding-right:10px;"><div id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></div>
<div id="header-description"><$MTBlogDescription$></div>
</MTIf>

I’m using the Unity Blue style for Babble On and added some top padding to the header name. In your stylesheet, at around line 218, you’ll see #header-name.

Add padding-top: 30px; to push the text down. You might need to play around with this to get it right for your blog.

Leave a comment



Recent Entries

  • Updated Joost Action Streams Plugin

    The plugin for [Joost Action Streams](http://mt4.juneeonline.com/babble-on/archives/2008/10/joost-action-streams-plugin.php) has been updated to include favourites. If you've previously installed this plugin I recommend deleting Joost from "Other Profiles"...

  • Adding the ShareThis Button to Mid-Century

    There's a tutorial on Rob Kenny's The Composing Stick with instructions for adding AddThis or ShareThis buttons to your posts. After receiving a request today,...

  • Joost Action Streams Plugin

    Joost is a website where you can watch good-quality videos of music, TV shows, movies, etc, and where members can add their own or one...

  • A Love Affair With Movable Type

    I spent a few hours last night reading through my early blog entries on Toni's Corner of the World while I re-established comments on the...

  • Pagination in Movable Type

    Much has been written on the various techniques for using pagination in Movable Type. Jesse Gardner posted an entry on "PlasticMind":http://blog.plasticmind.com/cms/movable-type-pagination/ that gives a good...

OpenID accepted here Learn more about OpenID