Sensible Link Management in Movable Type

| 4 Comments | No TrackBacks
Please note the following has only been tested on version four of the software!

After I had installed my Movable Type blog software, I was quickly coming up to speed on some basics necessary to publish an aesthetically-pleasing and comfortably-navigated blog. However, I quickly noticed a feature that is not readily available: customizeable link management.

One must pose the question why this feature is not part of the standard build. But, thanks to the guys and gals in #movabletype on freenode, I was pointed to a plugin called LinkRoller. The author of the software, "arvind", pushed me in the right direction, and thanks to the modular design of Movable Type, I was up and running quickly.

If you want the ability to customize your links within your blog, this is what you need. First, download the software and follow the installation instructions. Installation for me was a breeze, and I encountered no issues. The brief video on the installer page will quickly demonstrate how to create links. At this point, you should go ahead and create a link such as this one following the video provided on the download page. Use a sensible tag and description fields. This will be demonstrated shortly.

Now you must somehow display your links on your blog. To do this, you need to create a widget and then choose where to display it. Navigate to Design > Widgets in the control panel.  Select "Create widget template" from "Widget Templates" and enter "LinkRoller" in the top form field. Next, choose one of the following examples:

If you simply want all of your links displayed in one menu (not sorted), copy and paste the following code in code form field:

<div class="widget-linkroll widget">
    <h3 class="widget-header">Interesting Links</h3>
    <div class="widget-content">
    <MTLinks>
    <MTLinksHeader>
    <ul>
        </MTLinksHeader>
            <li><a href="<$MTLinkURL$>"><$MTLinkName$>: <$MTLinkDescription$></a></li>
        <MTLinksFooter>
    </ul>
    </MTLinksFooter>
    </MTLinks>
    </div>
    
</div>

This is good, but not necessarily satisfying or flexible enough for some. Naturally, I, along with others, wanted a mechanism to classify the link entries in accordance with tags. Thanks to one clever poster this can be done as follows:

<div class="widget-linkroll widget">
<h3 class="widget-header">Interesting Links</h3>
  <div class="widget-content">
    <mt:Tags type="asset" sort_by="name">
      <ul class="widget-list">
      <li><h4><mt:TagName></h4></li>
      </ul>
      <MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock>
      <ul class="widget-list">
        <mt:Assets type="link" tag="$linktag">
          <li><a href="<mt:AssetURL>"><mt:AssetLabel escape="html">: <mt:AssetDescription></a></li>
        </mt:Assets>
      </ul>
    </mt:Tags>
  </div>
</div>

After choosing one of the two options -- or rolling your own -- click save and return back to the widgets page. Before publishing your blog so you can see your links, the final step is to place the widget in your selected widget set. Under "Widget Sets", select your layout and drag your newly created widget from "Available Widget" to "Installed Widgets". Once you have pressed "Save Changes" and the system finishes the update, you can now publish your blog.

link_roller_widget.gif
Happy linking!

No TrackBacks

TrackBack URL: http://www.secnix.com/mt-cgi/mt-tb.cgi/5

4 Comments

I tried the code you have listed here and it broke horribly for me because I have other assets (images mostly) which are also tagged. So my blogroll was showing up with lots of empty headers since the tag had assets, but not link assets.

I modified the code to use the assetsHeader and assetsFooter tags and that appears to have solved the problem.

My code is below. Thanks for pointing me in the right direction.

<mt:Tags type="asset" sort_by="name">
<MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock>
<mt:Assets type="link" tag="$linktag" sort_by="label" sort_order="ascend">
<mt:assetsHeader>
<h4><mt:TagName></h4>
<ul class="widget-list">
</mt:assetsHeader>
<li class="widget-list-item"><a href="<mt:assetURL />"><mt:assetLabel /></a></li>
<mt:assetsFooter>
</ul>
</mt:assetsFooter>
</mt:assets>
</mt:Tags>

This is a great and very helpful description -- thanks!

One flaw, I think: I tried your first version of the code, with MTLinks and so on, and it didn't work at all. I got Smarty errors displaying in my blog. Is there an MTLinks tag?

But when I switched to using mt:Assets, everything worked fine. Here's the code I ended up using to mimic more or less how my old MT Blogroll section looked:

<div class="widget-linkroll widget">

<h3 class="widget-header">Links of Interest</h3>

<div class="widget-content">

<mt:Assets type="link" lastn="10">

<mt:AssetsHeader>

<ul>

</mt:AssetsHeader>

<li><a href="<mt:AssetURL$>"><$mt:AssetLabel$></a><mt:If tag="AssetDescription">: <$mt:AssetDescription$></mt:If></li>

<mt:AssetsFooter>

</ul>

</mt:AssetsFooter>

</mt:Assets>

</div>

</div>


How do you just list the links tagged in a particular way?

ie:

Here are my Links Tagged "Apple":

link1
link2
etc...

Thank you SO much for this post! I had figured out how to install and use the plugin, but had trouble organizing the links.

Leave a comment

About this Entry

This page contains a single entry by Justin published on August 27, 2008 12:09 PM.

Google Street View In My Neighborhood was the previous entry in this blog.

Red Hat Certified Engineer is the next entry in this blog.

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

Pages