Other Entries

Log

Delinking the Current Page in MovableType

A page shouldn’t link to itself.

It’s a general usability rule and just good practice. It’s always bothered me that MovableType doesn’t include logic to unlink the current page. I finally decided to fix it.

It’s only a problem for my site on the subject and monthly archive pages and I originally I thought about writing a plugin to target those two situations. Of course, ideally it would be more generic, which is where my reservations started.

After some research, I realized that it would be far easier to combine two existing plugins to do the work: Compare, and SetVarBlock.

Here’s a code snippet for the category template:

<MTSetVarBlock name="thispage"><$MTArchiveCategory$></MTSetVarBlock>
<ul>
  <MTCategories show_empty="1">
  <li><MTIfNotEqual a="[MTGetVar name='thispage']" b="[MTCategoryLabel]">
    <a href="<$MTCategoryArchiveLink$>">
  </MTIfNotEqual>
  <$MTCategoryLabel$>
  <MTIfNotEqual a="[MTGetVar name='thispage']" b="[MTCategoryLabel]">
    </a>
  </MTIfNotEqual></li>
  </MTCategories>
</ul>

And for the monthly archives:

<MTSetVarBlock name="thispage"><$MTArchiveDate format="%B %Y"$></MTSetVarBlock>
<ul>
  <MTArchiveList archive_type="Monthly">
  <li><MTIfNotEqual a="[MTGetVar name='thispage']" b="[MTArchiveDate format='%B %Y']">
    <a href="<$MTArchiveLink$>">
  </MTIfNotEqual>
  <$MTArchiveDate format="%B %Y"$>
  <MTIfNotEqual a="[MTGetVar name='thispage']" b="[MTArchiveDate format='%B %Y']">
    </a>
  </MTIfNotEqual></li>
  </MTArchiveList>
</ul>

01/28/05 02:17PM Accessibility and Usability Design Geekiness

Recently Played on iTunes

  1. “Abierto”
    Soul Food Taqueria
    Tommy Guerrero
    10/06/08 16:28
  2. “Hit Or Miss”
    Punk Rock Days: The Best Of DBL
    Down By Law
    10/06/08 16:25
  3. “Start!”
    Compact Snap
    The Jam
    10/06/08 16:22

Last 100 Songs >