September 14, 2004

Making a Sideblog or Linkblog

Updated Sept 14, 2004

A sideblog is a separate weblog which appears in the sidebar of your main weblog. Sideblogs are often used as a convenient way to list out interesting links, something akin to a frequently-updated, public list of IE favorites. Rather than mixing in your "this link is cool" entries in with all of your other entries, with the accompanying overhead of code for individual entries, comments and trackbacks, you can streamline your links into a linkblog.

A great example of a linkblog can be found at MovableBLOG�the Asides section in the right sidebar.

Making a sideblog is pretty straightforward; it can be accomplished by creating a new weblog in Movable Type and using either a plugin or an include to pull details from the new weblog into your main site. This tutorial will describe how to set up a sideblog and further refinements to turn your sideblog into a linkblog.

MultiBlog or PHP?
The two easiest ways to create a sideblog are by either using David Raynes' MultiBlog plugin or a PHP include. MultiBlog morphed out of MTOtherBlog which had the downside of having to republish your main weblog site in order to see changes made in the sideblog. MultiBlog has overcome that problem however and allows you to use a simple tag to include content from other MT blogs on the same installation. This is a great option if you don't have PHP installed. If your server supports PHP, and the page on to which you will be including the sidebar has a .php extension, using a PHP include is very easy. (See HTML or PHP? for more information.) There are, of course, other methods which I'm sure are equally effective�server side includes, for example. However, these methods tend to require more technical expertise than I have, so I won't be writing about them here.

This tutorial describes the PHP include method. If you want to use MultiBlog, download the plugin from the MT Plugin Directory, follow the instructions below for creating a new weblog, and use the tag instructions for MultiBlog to pull the new weblog data into the sidebar of your main weblog. (See Combining Multiple Blogs into One tutorial.)

Steps for making a sideblog and linkblog.

1. Create a new weblog in Movable Type.
Use the steps outlined in the Creating a New Weblog tutorial to create the weblog which will be the source of your entries for your sideblog.

As you will be using this new weblog as a sideblog to another main weblog you may not want to keep all of the default templates that come with the new weblog.
a. If you are not planning to offer a syndication feed for your sideblog, you can delete those templates. If you delete the syndication templates, you might also want to delete the link references to those templates in the headers of your remaining templates.
b. If you are planning to use the same stylesheet as your master weblog, point to the master weblog stylesheet on your templates. Do not delete the sideblog stylesheet if you plan to offer the MT search function for your sidebar (unless you make changes to your search template - see MT Keyword Search).
c. If this is a linkblog and you do not wish to offer comments or trackbacks for your links, you can delete the Individual Entry archive template in your templates window and de-select Individual archive type in the Archiving window of the weblog config. In this case you might use the date-based archive as your primary archiving method.
d. You may wish to delete the Master Archive List as well. (Its purpose is rather murky to begin with.)

If at a later time you decide you want these templates, you can get the defaults from Movable Type's website.

2. Create a new template.
PHP includes require the creation of the file that will be "included" into the main weblog. In your List Templates editing window of the new weblog, create a new index template. Name the template something obvious like "Links for Sideblog". Give the output file a .inc extension. For example, the output file for my linkblog is . In the file window, only put the tags that you wish to pull into your main blog (do not include any of the normal HTML headers).

Note that how you make your entries in the new sideblog weblog will determine the tags that you use. For example, in my link blog, I put the title of the link in the Title field, the http://www... link in the Entry Body, and a very short explanation in the Excerpt field.

The template that would generate a list of links based on the above described way of making the entries could looks something like this:

<MTEntries lastn="10">

<a href="<$MTEntryBody convert_breaks="0"$>" title="<$MTEntryExcerpt$>"><$MTEntryTitle$></a> [<a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>">#</a>]<br />
<$MTEntryExcerpt$><br />


Populate your new weblog with a few entries and test the output of your templates. The include file will not be formatted, but should have the data that you want.

3. Prepare your main weblog.
Make sure that the templates you are using that include your sideblog generate files with PHP extensions. Add the PHP include code into the sidebar sections of the templates of your main weblog on which you want the sideblog to appear. The PHP code will look like this:

include "/path/to/your/sideblogweblog/";

For example in my weblog, the PHP include to pull data in from my linkblog would look something like this:

include "/home/elise/public_html/linkblog/";

You will need to wrap the include in some formatting tags, like so (for MT3):

<h2>Cool Links</h2>

include "/home/elise/public_html/linkblog/";

Save and rebuild your site.

4. Further modifications.
The above instructions will get you started. Much of the work will be in how you choose to organize your sideblog. In my sidebar linkblog, I've chosen to also offer a link to the category archive page on which the link entry exists, which contains the notes I've written about the link. You could choose to have your notes on the sidebar itself, along with the links.

5. Searching both main blog and sideblog simultaneously

With the MT search form you can search both your main website blog and your sideblog at the same time and have search results pull from both blogs. To do this, add the following lines to your search form code:

<input type="hidden" name="IncludeBlogs" value="1" />
<input type="hidden" name="IncludeBlogs" value="3" />

Replace the value numbers with the blog IDs of the two blogs that you want to search. In this example, the search form would search blogs with the IDs 1 and 3. To see what blog ID your blog is, while in the MT edit window for the blog, look at the URL in the browser you are using. If your search form includes the following line:

<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />

replace the line with the code naming the actual blog IDs.

Notes: Easy Updating.
You can use a bookmarklet or QuickPost to easily add an entry to a sideblog or linkblog. Check it out in What is a QuickPost?.

MovableBLOG - great use of a linkblog
Anil Dash - another great example of a sidebar linkblog
Kevin Donahue's Creating a Sideblog Tutorial
Merging Your Blogs - Note from Arvind at Movalog on how to show both your Linkblog and Main blog on the same page.
Integrated Quicklinks Tutorial - Matt Kingston's instructions for how to do remaindered links. I found this code to be rather messy and altogether too complicated. Arvind's method using MultiBlog is an easier way to go.
David Raynes MultiBlog plugin
Sideblog RSS - tip for making your linkblog's RSS feed to direct the title of your entry to the linked page itself, rather than your linkblog.

Has this tutorial been helpful? Please consider linking to Learning Movable Type at . Thanks!

Posted by Elise Bauer on September 14, 2004 to General Tips and Tricks
Comments(8) | Email to a friend | Printer-friendly version


If you would like to send a trackback
please use the following URL:

» A Link Blog Template that Gives Credit from Katieweb: a user-centered viewpoint
An article at Digital Web Magazine discusses providing credit for ideas and links gleaned from other sources. Giving credit is not only courteous, it also helps others find and link to your blog, as described at Napsterization. Many people neglect......[read more]

Tracked: August 27, 2004 08:25 AM


I just thought that I should mention that the new OtherBlog, called MultiBlog, with the ability to have posting to one blog cause a rebuild of another blog's indexes should be out in a week or so.

Thanks David, I've made a mention in the tutorial. When it comes out let me know and I'll post the link.

thanks elise, for a very thoro tutorial. but there seems to be a minor problem i cant solve. in step 3 where you prepare the main blog, i saved the original index.html page as index.php, the sideblog works well, but now all the links (include the top banner) back to *main* on other pages still bring you back to index.html.... instead of index.php~ where can i go to change ? please help and thank you.

Chris - You need to delete the index.html file from your server. It competes with the index.php file and will trump it. I've just added this point to the HTML or PHP? tutorial.

thanks heaps, elise.. that solved the problem. thank you for the extremely helpful tutorial.

I want to let you know about a problem I ran into with the PHP include, which may or may not be common. After installing the sideblog, the following warning appeared on my main weblog: "stream does not support seeking..." A web search turned up a number of posts, most of which listed the remedy found at Thanks for the tutorial.

I've just set up a sideblog on using SSI. (I'm moving hosts at the moment, hence the ugly URL, I haven't sorted the DNS stuff).

Here's how to use SSI.....

In the Sideblog weblog, create a new index template called 'LinkBox'. Make it create a file called linkbox.html

Here is the template:
<div class="localfeed">
<h3><a href="<$MTBlogURL$>">Bookmarks</a></h3>
<li>Latest Links</li>
<ul><MTEntries lastn="10">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a> <$MTEntryBody convert_breaks="0"$></li>
<ul><MTArchiveList archive_type="Category">
<li><a href="<$MTArchiveLink$>"><$MTArchiveTitle$>(<$MTCategoryCount$>)</a></li>

Notice, it is not correct HTML as it stands, due to the fact that it has no head or body tags. It's an HTML fragment.

Include this feed in your main blog using an SSI include by putting this in the appropriate place:
<!--#include virtual="linklog/linkbox.html" -->

Note that the path is relative to the final position of your page, and it must be on the same server. Note also that the server must parse the page, so it will usually require an extension like .shtml or .htmls - you can change this by editing the template. You may need to delete the previous .html file manually.

Style your linklog (don't call it that - that's mine!) by the usual means.

I have used similar methods to get updates from other blogs on the same site onto one page.

This site has other default SSI you can use, it's just a case of dropping them in.

No rebuild of the main blog is neccesary when the LinkBlog is updated, only the LinkBlog needs rebuilding. This is because it's file is included 'on the fly'. Of course, changes might not be seen due to files being cached, but then, you should be familiar with this.

I recently used this tutorial to add a sideblog to my blog - worked perfectly and made it SOOO easy. I've continued to find your information incredibly helpful. Thanks so much and please keep it up!

Comments are now closed for this entry.

Email to a friend

Email this article to:

Your email address:

Message (optional):