wet_quicklink: Quick internal link builder for Textpattern articles

wet_quicklink (Screenshot)

wet_quicklink is a plugin for Textpattern which extends the article edit screen to add an easy method for defining site internal links targeting other articles.

Candidate target articles can be chosen by a wide variety of methods, ranging from sorting by post date or their assigned section, to a live content search inside the articles’ body or title.

wet_quicklink injects links into an article’s body, excerpt, title, or any custom field as either HTML, txp:permlink, txp:wet_link, Markdown, or plain URL markup (Textpattern 4.1.0 will probably be the first version supporting native Markdown notation, so I’m a little ahead of time for this).

Installation

  1. Textpattern 4.0.5 is required, wet_quicklink will not work with any prior version.
  2. Donate any amount you can afford to the developers of jQuery, which this plugin relies on, as they really deserve it. If you’d rather trade your money for something you can take home with you, consider John Resig’s book Pro JavaScript Techniques (John is jQuery’s lead developer).
  3. Install wet_quicklink.txt as a Textpattern plugin.
  4. Install wet_quicklink’s sidekick wet_peex.txt as a Textpattern plugin.
  5. Done. If all went well, the “content > edit” screen will sport a new menu entry called “Insert Link” located just above “Advanced”. Try it! Got this?

Usage

  1. Select the anchor text in the article title, body or excerpt text areas, or in any custom field.
  2. Click “Insert Link”.
  3. Locate the target article by browsing through the list. Narrow down the amount of listed articles by performing a live content search.
  4. Choose a markup method:
    • URL inserts a pure web address which is probably most useful with custom fields serving a special purpose (depends on your site’s architecture, of course).
    • HTML spits out plain old <a href="...">...</a> tags.
    • Textile is technically equivalent to HTML, but a little less verbose.
    • txp:permlink injects links based on the article’s id number so it will adjust to subsequent changes in your site’s URL mode, domain or root folder.
    • txp:zem_link and txp:wet_link add a dynamic title attribute to txp:permlink’s capabilities.
    • Markdown will serve you well when Textpattern 4.1.0 arrives. Keep it dormant until then.
  5. Click on the article’s title to insert the link.
  6. Rinse, repeat…

FAQ, or “Things I keep asking myself but hardly can remember…”

Q: How come I can only see “…” instead of my articles’ body text?
A: This is due to an overcome limitation in wet_peex 0.1. Updating wet_peex to version 0.2+ should cure this symptom.

Q: Will this work with any browser?
A: You are kidding, aren’t you? I have tested this with Firefox 2.0 on Windows XP and Ubuntu Linux 6.10, Internet Exploder 7.0, and Opera 9.10. I initially suspected that Safari adds any link to the end of the text and would not care for the active insertion point. But I apparently stand corrected as Marios Buttner, a Greek web designer and fellow Textpattern enthusiast, reports that all is well with Safari 2. Please leave a message with your own experiences.

Q: I’ve changed one of my articles recently, but those changes are not reflected in wet_quicklink’s article list. Why?
A: wet_quicklink encourages browsers to store the article list’s data for sixty seconds to reduce both your idling time and the traffic load for your site. During that period you might see a stale listing. So you could either have a short break… until… the… rest… of… this… minute… elapses, or clear your browser cache.

Q: This plugin tries to set a cookie. Are you hacking into my PC?
A: wet_quicklink uses two cookies to store the selected URL mode and the search term.

Q: “Insert Link”? Quel fromage! Ze menu must say “Verknüpfung einfügen”. Our international clients expect us to deliver localized software!
A: wet_quicklink uses translated texts by creatively recycling Textpattern’s stock translations, so just two additional texts are buried inside the plugin’s code. In order to change them, edit the plugin source and amend these two lines:

t_linktext : "Insert Link",  	// localize me!
t_loading : "Loading...",  	// localize me!

Q: The preview pane does not show any clickable links, although I can see them in the article’s edit screen.
A: Textpattern will only show HTML and Textile style links but suppress the output from <txp:permlink>, <txp:wet_link>, <txp:zem_link> or any other Textpattern tag.

Download

Get it here:

Resources and Relateds

Express your suggestions, report bugs and discuss enhancements in this thread in the Textpattern forum.

Credits

This plugin was inspired by Mary Fredborg’s upm_img_popper. Thanks to Alex King and the jQuery team for their contributions.

Change log

Date Version Notes
2007-02-22 wet_quicklink 0.2 Initial public release
2007-04-06 wet_quicklink 0.3 Load jQuery.js from the public location at code.jquery.com. Pro: No local installation required, better cacheability
2007-04-13 wet_quicklink 0.4 Added wet_link as another link method
2007-04-21 wet_peex 0.2 wet_peex 0.2 no longer relies on multi-byte string functions. Thanks, Ruud!
2007-04-26 wet_quicklink 0.4.1 Remove trailing space after anchor text
2007-05-05 wet_quicklink 0.4.2 More beautiful sort-order indicator arrows
2007-05-21 wet_peex 0.3 wet_peex 0.3 corrects a bug which affected the generation of HTML links in “/year/month/day/title” permanent link mode. Thanks, Rayne!
2007-09-16 wet_quicklink 0.4.3 Utilizes the jQuery script and graphics which come bundled with Textpattern 4.0.5
2007-09-18 wet_quicklink 0.4.4 Try harder to avoid clashes with other plugins which modify the “write” screen
2007-09-19 wet_quicklink 0.4.5 The “Thou Shalt Refrain from Violating the W3 HTML Standards” edition. Thanks, Maniqui!
Geschrieben am 21. Februar 2007. Mehr davon unter .

Ähnliche Beiträge