Recently in General Tips and Tricks Category

Have you ever wanted an easy way of showing a simple feed of your favorite sites within your blog? Blogger has a cool new feature called Blog List for Blogger blogs, and even if you are using Movable Type, or another blogging platform, you can make use of this Blogger feature to pull feeds into your blog.

Here's what it looks like on my site - Simply Recipes: Food Blog Updates:

updates-screen-shot.jpg

Which is driven off of this Blogspot page: http://foodbloglinks.blogspot.com/.

It's very easy to set up. Here are the steps in detail:

In Movable Type 4.0 users had the option of offloading the task of publishing to a separate program or application called Publish Queue. This had the advantage of dramatically increasing Movable Type's performance and reliability.

Most users run Pubish Queue via a scheduled task that wakes up at a fixed internal, executes and then quits. However, some users use Publish Queue's "daemon mode" to make it so that it is always running. But its own daemon mode does not have the capability to monitor and restart itself should it unexpectedly quit, exit or die.

Should Publish Queue crash the consequence would be that publishing would simply stop without you ever really knowing about it. Plus you couldn't start it up again without you manually going into the server and starting the publish queue up again. This rarely happens in actuality, but in a business critical application, you never want this to happen. Period.

Of course this problem is not unique to Movable Type. Many programs in Linux should be running at all times to ensure that the operating system functions properly. That is why there exists a suite of utilities in Linux called "damon tools." Together these tools can be configured to monitor any script and ensure that it is always running. If the script/application dies, then daemon tools will restart it. Handy.

This article discussed the process for those unfamiliar with daemon tools with how to get started and how to configure it so that you can relax knowing that Movable Type's background publishing engine will never stop running.

List Random Authors

| 2 Comments

As communities grow, so does the need to showcase your authors. Having a hefty community of authors is a great thing (content producers FTW!) but everyone wants their fifteen minutes. This handy little tip can help make sure everyone gets their fair share of the limelight.

A couple of things to note first: Make sure that you’ve got author archives set up. You can hack this to work with author profiles, but that’s not the scope of this tutorial. Also, this tutorial assumes that your server is parsing whatever page this is on as PHP. As a rule of thumb, if your file extension is .html, this probably won’t work; if you’re file extension is .php, you should be fine.

<?php
    $displayed_authors = array(); // Will hold indexes from $authors for authors already displayed
    $show = 25; // How many authors should we show?

    <mt:Authors>
        $authors[<mt:AuthorId />] = '<li><a href="<mt:EntryLink archive_type="Author" />"><mt:EntryAuthorDisplayName encode_php='1' /></a></li>';
    </mt:Authors>

    for ($i=1; $i <= $show; $i++) {
        $rn = array_rand($authors); 
        // Loops until it finds an author not displayed
        while(in_array($rn, $displayed_authors)) {
            $rn = array_rand($authors);
        }
        array_push($displayed_authors, $rn);
        echo $authors[$rn];
    }
?>

First, we set up an array where we’ll store all the authors that have already been displayed. More on that in a minute. Then we define how many authors we want to show with this block.

Share This Post in Movable Type 4

| 3 Comments

This isn't really a tutorial since I'm just advising you to install a plugin and giving you some reference html to make it look a tiny bit nicer than it does by default. However I still think this might be useful information for at least a few people so here we go:

Social bookmarking sites like Digg, del.icio.us, StumbleUpon and countless others are very popular with blogs and websites. Becoming popular on one of those sites attracts serious traffic and let's face it, most blogs and websites are always looking to boost traffic. So making it easier for people to "add to del.icio.us or "digg this" seems to be a good idea. By making it easier I mean we'll be adding links for several of the most popular social bookmarking tools to all existing and future entries for a given blog.

To accomplish this we're going to use the Promote This! plugin by Byrne Reese. Download and install the plugin per the directions. Once you've installed the plugin it's time to insert code into the Entry Detail template module. The Promote This! site gives the example of the code for adding a "digg this" link. If you follow that format you'll get a nice text link that works just fine. But if you want to jazz it up a tiny bit you can add the logos for each of the social bookmarking services you want represented.

sharethis.png

(This article is cross posted at MovableTweak.)

A client recently asked me if they could have an easy-to-manage banner ad setup, with the ability to add advertisements and specify links and alternate text, while at the same time being able to manage them easily. Sounds like a job for… Movable Type!

This tip can be used for any ads, or any images for that matter. There are four basic steps: upload the ad, create an entry for it, create the php file and include it in your template.

Putting MT:MultiBlog to Work

| 5 Comments

Last week on my personal blog I discussed how to put the MT:OtherBlog tag to use and compared that tag with using PHP includes to create the same functionality.

In the comments of that post J. Brotherlove reminded me of one serious advantage PHP includes have over using MT:OtherBlog: automatic updating. If I’m pulling content from Blog 1 with a PHP include into Blog 2 whenever Blog 1 is updated the pulled content is automatically updated on Blog 2. This isn’t the case when using MT:OtherBlog. When I update Blog 1 the pulled content on Blog 2 will not be updated until Blog 2 is rebuilt (either indexes or the entire blog depending on how you’ve got it set up). So after round 1 the score card finds MT:OtherBlog winning in the ease of use category but PHP includes winning in terms of actual useful functionality. So, a tie.

Nearly every article for my site Correspondence Notes contains at least one image. I use Movable Type's built in upload feature to upload images and add them to entries. The process is fine except for one step. By default Movable Type will upload images to your Site Root. That's great except I like my images to go into a subdirectory I like to call...images. I can of course, with the file upload utility, tell Movable Type to put the images into the images subdirectory. The problem is that the utility will not remember this preference. Every time I upload an image I have to tell Movable Type again to put the new image in the images directory instead of the Site Root. Though it only takes a few key strokes to type "images" into the subdirectory field it's a silly time waster since I want every single image I upload to go into that folder.

Since there isn't an option within the Movable Type user interface to make the file upload utility remember that I want my images to always go into the images subdirectory I decided to go straight to the source and make it happen.

Movable Type Firefox Shortcut

| 1 Comment

I'm constantly bringing up different client's Movable Type installs for maintenance, and typing out the full path to Movable Type gets old quick. If you install MT to a consistent location (/cgi-bin/mt/mt.cgi) as I do, I've got a little Firefox shortcut that will make your life easier.

In Firefox, go to the bookmark management/organization section. Create a new bookmark.


Name: Movable Type
Location: http://%s/cgi-bin/mt/mt.cgi
Keyword: mt

Now just type 'mt yourclientsite.com' and Firefox does the heavy lifting. If you want a FastCGI rendition, just create another bookmark with mt.fcgi and set the keyword to 'mtf'. It's totally flexible, just put in your standard installation location and you're off!

Automatic Copyright Notice Year Update

| 4 Comments

Every year come January we have to start signing checks with a new date. One little site detail that often gets overlooked is the date on the copyright notice (if you have a copyright notice) for your blog. If your site is PHP friendly, you can replace the copyright date with a little php script that automatically puts in the correct year.

Replacing the date with <?php echo date('Y'); ?> will do the trick. For example, the copyright code for LMT is:

Copyright &copy; 2004-<?php echo date('Y'); ?>

There's probably a way to do this just with using MT tags. Anyone know how? If so, please let us know in the comments and I'll add it to this post.

Entry Titles Linked to Permalinks

| 11 Comments

mtbadge-small.gif If you are using Movable Type default templates, the titles of your entries on the main page of your MT blog are just that - titles. They look pretty but go nowhere. If you want to get from the entry on your main blog page to its individual entry page, you need to click on "Permalink" or "Continue reading".

Setting it up so that the titles of the entries themselves are hyperlinks to the individual entry page is fairly straightforward and requires edits to two templates - your Style Sheet and the Main Index template.

1. The Stylesheet The MT3.2 default stylesheet is a huge file. The last time I printed one out it took 18 pages. It is easiest to edit your stylesheet by opening the stylesheet template and copy and pasting the entire template into a text editor (e.g. BBEdit for the Mac). The stylesheet is divided in sections. The first section is called Base Weblog, and contains the sub-sections basic elements, standard helper classes, page layout, banner user photo, content, modules, position everything, and mt calendar. Do not make changes to anything in this Base Weblog section. Keep going until you find your theme section. In the case of the template that comes with a new MT weblog, the beginning of the theme section is this:

/* Vicksburg (theme-vicksburg.css) */

Right after the /* basic page elements / section, you'll see the / page layout */ section. Find the .entry-header class. It will look like this:

.entry-header
{
   margin-top: 0;
   border-left: 5px solid #dae0e6;
   padding: 0 0 0 10px;
   color: #666;
   font-size: 18px;
}

About this Archive

This page is an archive of recent entries in the General Tips and Tricks category.

Feeds is the previous category.

HTML and Javascript is the next category.

Find recent content on the main index or look in the archives to find all content.