Recently in Movable Type Category
Share This Post in Movable Type 4
January 19, 2008
| Permalink
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.
![]()
To get those handy little icons for each service you need to grab either the favicons or other logo button provided by the services. In the code below I'm hotlinking to all the images. I don't recommend you do this, it's just to show you the addresses of all the icons so you can grab them yourself and upload them to your own space.
This code will give you quicklinks to the sites that I've chosen to use/link to. Promote This! supports several other sites so feel free to add and subtract links as you like.
<strong>Share this post:</strong><br/>
<img src="http://digg.com/favicon.ico"><a href="<$MTDiggURL$>">digg</a>
<img src="http://del.icio.us/favicon.ico"><a href="<$MTdeliciousURL$>"> del.icio.us</a>
<img src="http://reallystatic.reddit.com/static/favicon.ico"<a href="<$MTredditURL$>">reddit</a>
<img src="http://www.newsvine.com/favicon.ico"><a href="<$MTNewsvineURL$>">Newsvine</a></td>
<br/><img src="http://www.google.com/favicon.ico"><a href="<$MTGoogleURL$>">Google Bookmark</a>
<img src="http://www.facebook.com/favicon.ico"><a href="<$MTFaceBookURL$>">FaceBook</a>
<img src="http://www.stumbleupon.com/images/icon_su.gif"><a href="<$MTStumbleUponURL$>">Stumble Upon</a>
I've chosen to have links at the end of blog posts, before comments so I've placed the code, in the Entry Detail template module, between
<$MTInclude module="Categories"$>
and <$MTInclude module="Tags"$>
Update: I cross-posted this at Learning Movable Type and on the comments to that post Chad Everett left a comment that mentioned two alternative tools for achieving the same thing without using any plugins.
Good post - though I've been trending away from multiple links and trying to stick with a single button that provides this sort of functionality. One option is sharethis, but I personally find that rather heavy, JavaScript-wise, and it doesn't always work well.My current favorite is addthis. It's not as pretty, to be sure, but it provides a single button (you can choose from several styles), they offer a subscribe button as well, and you can easily view reports to see what has been popular on your site - no plugins to worry about!
Add Scrollbars to Image Popup Windows in Movable Type 4
November 22, 2007
| Permalink
| Comments (0)
I post a lot of thumbnail images on Consuming Louisville that link to very large full size images. By default Movable Type doesn't add scrollbars or allow resizing for the popup windows created for images. That's a problem because those large images of mine get cut off with no way to expand the window or scroll to see the rest of the image. So of course I needed to turn on scrollbars and turn on window resizing for image popups.
Like with changing the default image upload location I wish that there was a simple way, within the Movable Type application, to do this but there isn't one as far as I know. Instead we have to do a little monkeying around with the Movable Type application code. But, again like with changing the default image upload location, the is actually quite simple and only requires editing a single line of a single file.
The file to edit is called Image.pm. Assuming you have your Movable Type files in your cgi-bin the path to this file looks something like cgi-bin/mt/lib/MT/Asset/Image.pm.
1. Download Image.pm (I highly recommend you save a backup copy of it before you edit it)
2. Open Image.pm and look for the following:
q|<a href="%s" onclick="window.open('%s','popup','width=%d,height=%d,scrollbars=no,resizable=no,
toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">%s</a>|,
3. Change scrollbars=no,resizable=no
to scrollbars=yes,resizable=yes
So your final code should look like:
q|<a href="%s" onclick="window.open('%s','popup','width=%d,height=%d,scrollbars=yes,resizable=yes,
toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">%s</a>|,
4. Save and upload Image.pm
Now, the next time you have Movable Type create a popup window for the full size version of an image that popup window will have scrollbars and viewers will be able to resize it.
How To Change the Default Image Upload Location in Movable Type 4.0
November 22, 2007
| Permalink
If you're using MT4.1 see the note at the end of this article.
I have a site called Correspondence Notes. The site is about written communication as well as the tools and materials that go along with it. It contains lots of fawning over and geeking out about stationery and note cards. Like all of my sites Correspondence Notes is powered by Movable Type.
Nearly every article for 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. Please remember that if these steps break your copy of Movable Type I'm not the least bit responsible.
Configuring the upload utility to upload to the same subdirectory by default is actually quite simple. It only requires editing a single line of a single .tmpl file. However, if monkeying with an application's source code makes you really nervous I've heard there is a great plugin for improving Movable Type's file upload utility that only costs $10.
The file to edit is called asset_upload.tmpl. Assuming you have your Movable Type files in your cgi-bin the path to this file looks something like cgi-bin/mt/tmpl/cms/dialog/asset_upload.tmpl.
1. Download asset_upload.tmpl (I highly recommend you save a backup copy of it before you edit it)
2. Open asset_upload.tmpl and look for the following:
/ <input name="extra_path" id="extra_path" value="<mt:var name="extra_path" escape="html">" />
3. Change
value="<mt:var name="extra_path" escape="html">"
to
value="images"
where "images" is whatever subdirectory name you want your images uploaded to by default.
So your final code should look like this
/ <input name="extra_path" id="extra_path" value="images" />
4. Save and upload asset_upload.tmpl
5. Upload an image
You'll notice that the subdirectory field is still completely editable. So while Movable Type will, by default, now upload my images to the images subdirectory, should I want to upload a particular image to a different directory all I have to do is type a different name into the subdirectory text box.
Update for MT4.1 This procedure is almost exactly the same in MT4.1. The only difference is the actual location of the asset_upload.tmpl file.In MT4.0 the file was found here: cgi-bin/mt/tmpl/cms/dialog/asset_upload.tmpl
In MT 4.1 the file you want to edit is now: cgi-bin/mt/tmpl/cms/include/asset_upload.tmpl
Make Flickr's Blog This Feature Work with Movable Type 4.0
November 8, 2007
| Permalink
| Comments (0)
This tutorial is cross posted at On a path media
Actually this applies to any version of Movable Type since 3.2 and to all kinds of external apps for posting to your Movable Type blog. I just suspect that the Blog This feature from Flickr is probably the most popular external blogging tool out there and it's really frustrating when you can't get it to work.
I should mention this post was inspired by my friend Cecily who recently wrote about posting from TextMate to a Movable Type blog. Her post reminded me about how the web services password can cause problems when setting up a Movable Type blog to work with Flickr's Blog This feature.
When you go to setup your Movable Type blog with Flickr you'll be asked for your password. Many folks put in their password only to be told its incorrect. They check and double check and absolutely certain they're putting the right password in only to still be rejected. The problem is that Flickr doesn't want your main blog password (the one you use to login to your blog with). What Flickr wants is your web services password.
If you don't know what your web services password is that probably means you haven't set one up yet. System Overview -> Users -> Your User Identity
Continue reading Make Flickr's Blog This Feature Work with Movable Type 4.0.
Creating Printer Friendly Versions of Blog Entries with Movable Type 4
October 24, 2007
| Permalink
| Comments (8)
There are several methods available for creating printer friendly pages of websites but I’m only going to focus on one. Using Movable Type’s dynamic publishing option we can create on-demand printer friendly pages of weblog entries. Cool.
Roll up your sleeves because this method includes changing a blog’s publishing settings, creating a new archive template, archive mapping setting and adding links to an existing template module. It’s really not all that daunting but it was cool to maybe make it sound daunting and hard there for a minute.
Go to Preferences -> Publishing
Under Publishing Options find “Publishing Method” and change it to “Set each template’s Publish Options separately.”
Check “Enable conditional retrieval”
Go to archive templates - > Create a new entry template
Let’s call the new template something like Print. For printer friendly pages I only want the my site’s header, entry title, entry date and entry body to print. I don’t want comments or trackbacks, sidebar content or footer content. So in my new Print template I only include the necessary archive variables and then code for the specific content as follows:
<MTSetVar name="body_class" value="mt-archive-listing mt-entry-archive">
<MTSetVar name="sidebar" value="1">
<MTSetVar name="module_about_context" value="1">
<MTSetVar name="body_onload" value="individualArchivesOnLoad(commenter_name)">
<MTSetVarBlock name="page_title"><$MTEntryTitle remove_html="1"$></MTSetVarBlock>
<$MTInclude module="Header"$>
<b><$MTEntryTitle$></b><br/>
<$MTEntryDate format="%x"$>
<MTIfNonEmpty tag="EntryBody">
<$MTEntryBody$>
</MTIfNonEmpty>
<MTIfNonEmpty tag="EntryMore" convert_breaks="0">
<div id="more" class="asset-more">
<$MTEntryMore$>
</div>
</MTIfNonEmpty>
Before saving make sure to click the box to Enable dynamic publishing for this template. After saving you’ll be able to edit the template’s archive mapping. This is important. This determines that address of your printer friendly page.
So click Create Archive Mapping, leave type set to Entry and choose add. After the archive mapping has been created we need to edit it to a custom address for our printer friendly pages. From the pull down menu select custom and edit it to your liking. This is the custom archive mapping that I’ve used:
%y/%m/%F/print/index.html
That mapping means the address for my printer friendly pages will looking something like: domainname.com/2007/10/entryname/print/.
Next we have to create a link to our printer friendly pages. In the entry metadata template module add the following code wherever you want your printer friendly link to be:
<a href="<mt:BlogArchiveURL><mt:EntryDate format="%Y/%m">/<mt:EntryBasename separator="-" />/print/">Printer friendly version</a>
One note about this code, notice the separator attribute with the mt:EntryBasename tag. By default mt:EntryBasename will spit out urls like so base_name.html. The problem is that my actual archive urls are base-name.html. See the difference? It’s underscore versus hyphen. Without the separator attribute the urls created by the mt:EntryBasename tag wouldn’t match the actual address of the printer friendly pages the new template is going to be creating.
Rebuild your entire site. Marvel at the magic of printer friendly pages.
As always if I've made any mistakes or if you have any questions please let me know.
« Mac | Main Index | Archives | Software »