Almost Recent Entries

There are some things about blogging that just doesn't make sense, take recent entries as an example. On the front page you have maybe your last 10 posts, next to that you have a recent entries widget showing your last 10 posts, what is the point? Shouldn't it be a teaser to additional content?

The code below is a replacement for the recent entries widget code, Included on the front page it will show the previous 10 entries following the last entry on your index page. While on your archive pages it functions as a 'normal' recent entry widget.

<mt:If name="main_index">
<mt:SetVarBlock name="entryOffset"><mt:EntriesCount></mt:SetVarBlock>
<mt:else>
<mt:SetVarBlock name="entryOffset">auto</mt:SetVarBlock>
</mt:If>
<mt:If tag="BlogEntryCount">
    <mt:Entries lastn="10" offset="$entryOffset">
        <mt:EntriesHeader>
<div class="widget-recent-entries widget-archives widget">
    <h3 class="widget-header">Recent Entries</h3>
    <div class="widget-content">
        <ul class="widget-list">
        </mt:EntriesHeader>
            <li class="widget-list-item">
                <h4><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h4>
                <p><mt:EntryBody words="25" convert_breaks="0" />...</p>
            </li>
        <mt:EntriesFooter>
        </ul>
    </div>
</div>
        </mt:EntriesFooter>
    </mt:Entries>
</mt:If>

A few years ago Six Apart's Anil Dash posted this article about using Movable Type to generate a Word document of your blog or part of it. It uses WordML to generate a Microsoft Word 2003 formatted documents. This is fine and dandy if you have Word, but what if you don't?

As Anil's post shows, it is very easy for Movable Type to generate any document type that you know the specification, so lets give it a go with another ubiquitous file format; Rich Text Format, the full specification can be downloaded from Microsoft

Below is a simple template which outputs a Rich Text Formatted file showing the last 5 entries from your blog.

{\rtf
{\b <MTBlogName>}
\par
<MTEntries lastn="1">
Author: <MTEntryAuthorNickname encode_xml="1">
\par
Modified: <MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ">
\par
</MTEntries>
\par
\par    
<MTEntries lastn="5">
{\b <MTEntryTitle>}
\par
<MTEntryBody  convert_breaks="0" remove_html="1">
\par
\par
</MTEntries>
}

you need to create a new custom index template and paste the above code in. Set the output file to recent.rtf. When this template is published it generates a rich text format file at your blog root that contains the last 5 entries in your blog.

This technique can be used for a number of different formats; OOXML, LaTex or OpenDocument for example. It can also be expanded to include a list of recent comments or limit the report to specific tags, categories or keywords.

Recently Yahoo have introduced Yahoo Buzz, a social news site, similar to Digg. Yahoo determines the most popular search topics and then, we showcase the most popular stories within those topics, based on activities like voting and emailing stories to friends.

If you want people to be able to vote, you need to add a button to your page, Yahoo has a list of button code, but to make the system really fly you can add extra post information that will get submitted. This is easy to do in Movable Type, first we need to create a new module template called Yahoo Buzz and past the following code into it.

<script type="text/javascript">
yahooBuzzArticleHeadline = "<mt:EntryTitle>";
yahooBuzzArticleSummary = "<mt:EntryBody words="15">";
yahooBuzzArticleCategory = "<mt:EntryCategory>";
<mt:EntryIfTagged tag="@text">
    yahooBuzzArticleType = "text";
</mt:EntryIfTagged>
<mt:EntryIfTagged tag="@image">
    yahooBuzzArticleType = "image";
</mt:EntryIfTagged>
<mt:EntryIfTagged tag="@video">
    yahooBuzzArticleType = "video";
</mt:EntryIfTagged>
    yahooBuzzArticleId = window.location.href;
</script>

<script type="text/javascript"
    src="http://d.yimg.com/ds/badge2.js"
    badgetype="large-votes">      
</script>

save this and then open the entry template, scroll down until you find

 </mt:EntryIfTagged>

and after that add

 <mt:Include module="Yahoo Buzz">

rebuild your site and each entry should now have a Buzz button at the end, just before any comments.

You set the category as you would normally do in Movable Type and you set the Article Type through the use of private tags (@text, @image, @video).

This is a first draft template and a little rough as stories can only have one category. Ways to improve / change this would be to have custom fields to store Category and Article Type.

Site Upgraded

As regular visitors may notice, the site has changed slightly. After upgrading to Movable Type 4.21 I took the opportunity to try out the Mid-Century template set by Jim Ramsey . Over the next month I will give it a few tweaks to personalise the design.

The upgrade went smoothly, just ftp'd the files over the top of the existing installation. I also upgraded www.darrenkenny.co.uk, you won't see any changes to the design at the moment, but again that will be happening soon.

Updates

Movable Type 4.21 is out, with some major security fixes so it is time to update. I am also going to take this opportunity to try out some of the new styles and templates so you might see a few changes over the next few weeks.

When the Composing Stick was being set up I encountered a problem with my web host's security configuration. When I tried to log on to Movable Type I would get the error

Got an error: Error opening file '/mt-config.cgi': No such file or directory

This was easily solved by editing lib/bootstrap.pm

sub BEGIN {
    $ENV{'MT_HOME'} = '/home/username/public_html/mt';
    my ($dir, $orig_dir);
    require File::Spec;
    if (!($dir = $ENV{MT_HOME})) {

Line 2 was added with the full path to Movable Type and the system started working

Recently I went to configure Microsoft Live Writer and during the configuration process I got the error again. A quick check showed that the web site was functioning correctly, so why not Live Writer?

The answer, it turns out, is very simple. Live Writer communicates with Movable Type through mt-xmlrpc.cgi, this does not use bootstrap.pm so the code needs to added to mt-xmlrpc.cgi as well

sub BEGIN {
    $ENV{'MT_HOME'} = '/home/username/public_html/mt';
    require File::Spec;
    if (!($dir = $ENV{MT_HOME})) {

Once this has been done the Live Writer is able to link up and you can post to your blog

Flickr is an online photo management site (some might say it is the online photo management site). Users upload their photos to share amongst friends and strangers.

Vox is an social blogging site, brought to you by Six Apart, the same company that brought blogging to the masses with the Movable Type blogging platform and Typepad a hosted solution.

Vox allows you to link to your Flickr account and import images as assets, but this is a manual process, there is no easy way to automate this. Another option is to add a Flickr badge to your sidebar. These badges can be flash based or simple html and can be customised to some degree to match you site style.

The first step is to get the badge code.

  1. Go to to http://www.flickr.com/badge.gne (you will need to be signed into flickr).
  2. Follow the on screen instructions and at the end you will be given a snippet of code to paste into a page below is some sample code for the flash based badge.

<!-- Start of Flickr Badge -->
<style type="text/css">
.zg_div {margin:0px 5px 5px 0px; width:117px;}
.zg_div_inner { color:#666666; text-align:center; font-family:arial, helvetica; font-size:11px;} .zg_div a, .zg_div a:hover, .zg_div a:visited {color:#3993ff; background:inherit !important; text-decoration:none !important;} </style> <script type="text/javascript"> zg_insert_badge = function() { var zg_bg_color = 'ffffff'; var zgi_url = 'http://www.flickr.com/apps/badge/badge_iframe.gne?zg_bg_color='+zg_bg_color+'&zg_person_id=????????zg_tag_mode=any';
document.write('<iframe style="background-color:#'+zg_bg_color+'; border-color:#'+zg_bg_color+'; border:none;" width="113" height="151" frameborder="0" scrolling="no" src="'+zgi_url+'" title="Flickr Badge"><\/iframe>'); if (document.getElementById) document.write('<div id="zg_whatlink"><a href="http://www.flickr.com/badge.gne" style="color:#3993ff;" onclick="zg_toggleWhat(); return false;">What is this?<\/a><\/div>'); } zg_toggleWhat = function() { document.getElementById('zg_whatdiv').style.display = (document.getElementById('zg_whatdiv').style.display != 'none') ? 'none' : 'block'; document.getElementById('zg_whatlink').style.display = (document.getElementById('zg_whatdiv').style.display != 'none') ? 'none' : 'block'; return false; } </script> <div class="zg_div"><div class="zg_div_inner"><a href="http://www.flickr.com">www.<strong style="color:#3993ff">flick<span style="color:#ff1c92">r</span></strong>.com</a><br> <script type="text/javascript">zg_insert_badge();</script> <div id="zg_whatdiv">This is a Flickr badge showing public items from <a href="http://www.flickr.com/photos/????????">Your Name Here</a>. Make your own badge <a href="http://www.flickr.com/badge.gne">here</a>.</div> <script type="text/javascript">if (document.getElementById) document.getElementById('zg_whatdiv').style.display = 'none';</script> </div> </div> <!-- End of Flickr Badge -->

  1. Log into Vox, at the bottom of your sidebar you should see a link called Dress up your sidebar.
  2. Click on the link.
  3. Give the widget a Name, e,g. My Pictures
  4. Paste the code into the Widget Code box and click OK.
You now have a flash based flickr badge on your page, however there are some problems as you can see from this screenshot.
vox-flickr.jpg The badge is flush to the left of the sidebar and the height is wrong, the badge is cut off. What we need to do is make a few changes for the code. We will start by centering the badge in the sidebar by removing the fixed margins and replacing them an automatic margin like so

.zg_div {margin: auto; width:117px;}

Now we need to get some height on the div that contains the flickr badge

<div class="zg_div" height="300"><div class="zg_div_inner"><a href="http://www.flickr.com">www.<strong style="color:#3993ff">flick<span style="color:#ff1c92">r</span></strong>.com</a><br>  

Now your Flickr badge should be sitting nicely in the middle of the sidebar full height. Take a look at my Vox page to see the final results.

The problem with most of the forum software out there is that, for performance reasons, there is a minimum word length for search terms; for most this is 4 characters or more. This limitation is fine for most purposes but technology tends to be full of TLA's which makes searching a pain. An example recently; trying to help a user on the Movable Type forums I needed to look up previous posts about 403 errors. Searching within the forum for 403 returned no hits.

One trick is not to use the forums built in search facilities, but use Google instead. Most people that use Google do not know that you can limit your searches to a specific site by the following:

site:http://forums.sixapart.com <search>
this will find all occurrences of <search> on the site specified, for example:

site:http://forums.sixapart.com 403
helped me find all the posts about 403 errors in the forums.

For more information on this, and other useful search terms see: http://www.google.com/help/operators.html

Gallery

Recent Comments

Close