Had a thought for another plugin this morning and figured it might be a useful one.
Sometimes on long posts the links can get lost, so I’m going to see what I can do about putting together a plugin that will create a list of all the external links in a post or page down on the bottom as a footnote.
And I’m pretty much posting about it now so I have to do it and can’t just let the idea slide. Plus it lets me get the tag setup.
#1 by (somewhat) Happy user on May 15, 2011 - 12:46 am
today I started looking for a plugin that does exactly what “Link Footnotes” delivers in hopes of avoiding to write my own. So for that – thanks from my lazy self.
One suggestion for improvement though: each link is wrapped in “broken” HTML – “<ul></ul>” combo instead of conventional “li”. No big deal – I patched it up and it’s all good now, but it would be nice if it was incorporated in your code so I don’t have to re-patch it every time you post an upgrade. Maybe an option in UI that would make it “optional” but IMO it’s broken as-is since it produces poor HTML code.
#2 by (somewhat) Happy user on May 15, 2011 - 12:50 am
ugh, forgot to mention – neat feature to add: grabbing the title of the target page and using it in listings. but that may need to be offloaded to some background job since doing it on every page render could be disastrous.
#3 by (somewhat) Happy user on May 15, 2011 - 1:08 am
Should have really gathered my thoughts before posting :) Just hit some “unpleasant” quirk – reoccurring links show up multiple times. So I have just injected a bit of code like this:
$unique_links=array_unique($rayMatches[1]);
foreach ($unique_links as $link) {
#4 by Ryan on May 15, 2011 - 6:06 am
It should have been li. That was me just not thinking. And I didn’t think to test with duplicate links. Appreciate the notes, and I’ll get both of ‘em rolled in to an update.
Grabbing the title would be a cool feature, although like you said there’d have to be some way to do it away from the page load. Maybe when the post / page is published and then save the titles in a meta field so it’s cached.
#5 by Happy user on May 17, 2011 - 12:42 am
awesome! 0.1.5 works as expected. much thanks :)