« Colors - Background, Banner, Headline, and Font | Main | Alphabetize Your Entries »

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.
movableblog.gif

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 here, 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 links.inc . 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 />

</MTEntries>

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:

<?php
include "/path/to/your/sideblogweblog/sideblog.inc";
?>

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

<?php
include "/home/elise/public_html/linkblog/links.inc";
?>

You will need to wrap the include in some formatting tags, like so:

<h2>Cool Links</h2>

<ul><li>
<?php
include "/home/elise/public_html/linkblog/links.inc";
?>
</li></ul>

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?.

Links:
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.
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.