Recently in Tutorial 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!
Getting www33.not-found-entry.org? Blame Insight
December 9, 2007
| Permalink
| Comments (3)
Let me preface this by saying I'm not an Insight hater. Until this issue I've had absolutely no complaints with my Insight service. That being said a few weeks ago I started noticing that if I mistyped a URL or went to a web address that was down instead of getting the typical, blank "Page Not Found" or "Can't find the server" pages I was instead being directed to www33.not-found-entry.org and a page full of ad links. If I were a Windows user I'd have been really concerned that my machine had been infected with spyware or malware that was hijacking my browser and sending me to a spammy page full of paid links. Being a Mac user though I noted the weird spammy page and made a note to look into it a bit later.
A bit later turned out to be yesterday and when I looked into this issue I found out that, well, Insight has done something that at best can be considered tacky and at worst could be considered a dirty business practice. Several weeks ago Insight rolled out a bug "feature" in the Louisville area (after first rolling it out in Northern Kentucky) that redirects browsers to www33.not-found-entry.org pages whenever the browser should be delivering a server not found message. The www33.not-found-entry.org pages are populated with links that are, in a best case scenario, related to the site you were actually trying to find. All of these links are ads. If you click on these links you're clicking on advertising. Whoever owns the pages running those ads (and I assume but haven't been able to confirm that Insight owns the pages) gets money when you click on those ads. I'm ok with online advertising but I'm not ok with hijacking my browser to show me a page full of ads instead of the generic informational error pages I should be seeing.
Continue reading Getting www33.not-found-entry.org? Blame Insight.
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
Take Your Gmail Contacts to Thunderbird (Mac Only)
November 8, 2007
| Permalink
| Comments (2)
As soon as Gmail rolled out IMAP support I jumped on the band wagon and started configuring Mail.app and dipping my toes back into the desktop email client waters. Things didn't go as smoothly as I hoped. I found the combination of IMAP, Gmail and Mail to be less than optimal. Then I found Lifehacker's article on how to "Turn Thunderbird into the Ultimate Gmail IMAP Client" and decided to give Thunderbird a go. A week in I find Thunderbird to be pretty great and using it in concert with Gmail is working out pretty well. One major problem though is that, as far as I can find, there isn't a direct or simple process for getting your Gmail contacts into Thunderbird. You can export your Gmail contacts into a .csv file but it doesn't play nicely with Thunderbird in my experience. It doesn't play nicely with Address Book either (I know I tried getting my Gmail contacts into Address Book over the summer).
After much digging I finally found a work around for getting Gmail contacts relatively neatly into Address Book. I also found a work around for getting Address Book contacts into Thunderbird. Put those two processes together and you've got your Gmail contacts in Thunderbird.
Let me warn you that this is a rather convoluted process that requires you to download and run an Apple Script and an application and even then your address book probably won't be exactly perfect (meaning you'll have to either edit a .csv file or edit your contacts post-Thunderbird import) nor will your Gmail contacts and your Thunderbird contacts stay synced. The lack of syncing is obviously not ideal. However, I have a rather large, static base of contacts that I needed to have in Thunderbird that doesn't get changed. The number of new contacts I get it isn't minuscule but it is small enough that I can manually add them to both places if need be. If you get 15 new contacts a day this probably isn't an optimal solution for you.
The first step is in this process is exporting your Gmail contacts. In the export options choose Gmail to Outlook CSV. Next download Steve Roy's Address Book Importer 2.0.5. This app is free if you use it only once. If you want to use it more a $10 fee is requested. Address Book Importer has a drag and drop interface that allows you to get the contact information from the Gmail .csv into the proper address book fields. Depending on how meticulously detailed your Gmail contacts list is you could be dragging and dropping a lot or a little. Either way this is going to take a little time. I accepted that, went through the process and was happy I did.
After your Gmail contacts have been safely imported into Address Book download and run the Address Book to CSV AppleScript from Sean Long (hint get the full package listed in the comments of that link instead of just the .scpt file). This script will spit out all of the contacts in Address Book into a new .csv file. The drag and drop process you used with Address Book Importer should have allowed the new .csv file to be nice and tidy and just the way you like it. Meaning it will play nicely with Thunderbird unlike the original .csv file that Gmail created.
So just go to your Thunderbird address book, import the new .csv file and think to yourself "There has got to be an easier way than this but I'm glad this worked for now."