26 June 2003

simple uses for a complicated tool

Seeing as I use a very simple kluge to separate the links and writeups for my (other) blog, I needed a simple kluge to get the titles of my links back out. Surely, I thought, nobody else puts a link in EntryMore with only "link" for text and the actual site name in the link title, thus nobody would've made such an otherwise pointless plugin. Whilst searching for information on how to develop my own, I stumbled across Kevin Shay's Collect, which while being much more useful and powerful, nevertheless can easily be coaxed into doing precisely what I want. Non bloggers need not read on.

Basically, my entries are structured like this: a couple paragraphs in the regular Entry describing a link given in the EntryMore, as in this example:<a title="Ketchup, my links blog" href="http://mikelietz.org/ketchup/">link</a">It's set up this way to be easily updatable and consistent, and so far it works pretty well. The problem I encountered is that all of my EntryMores read exactly the same text: link, and only can be told apart in a browser supporting title attributes. And MT doesn't natively support any sort of a->title parsing. So for me to make a master list of every link ever blogged, I'd need some help. Enter a plugin.

I stumbled across Collect, and with a little trial and error I came up with this snippet of code. It spits out the entry's title and a link named with the link's title. Not too bad for ten minutes' work. My index template using it is now functional if not totally styled, and you can see it here. My code is below for anyone interested, though I doubt anyone else is cheating quite in the same way I am.

<MTEntries lastn="999999">
<MTCollect tags="a">
<$MTEntryTitle$>
<MTCollectThis>
<$MTEntryMore$>
</MTCollectThis>
<MTIfCollected tags="a">
<MTCollected tags="a">
<a href="<$MTCollectedAttr attr="href"$>"><$MTCollectedAttr attr="title"$></a>
</MTCollected>
</MTIfCollected>
</MTCollect>
</MTEntries>

no comments on simple uses for a complicated tool

add your comment

I can and will moderate any and all comments at my discretion. I will not ever display or reveal your email address without your permission.

your contact information

your comment