wet_quicklink: Quick internal link builder for Textpattern articles

21. Februar 2007

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, or plain URL markup.

Installation

  1. Textpattern 4.3+ is required, wet_quicklink will not work with any prior version.
  2. Install wet_quicklink.txt as a Textpattern plugin.
  3. Install wet_quicklink’s sidekick wet_peex.txt as a Textpattern plugin.
  4. Done. If all went well, the “content > write” screen will sport a new menu entry called “Insert Link” located just above “Advanced Options”. 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:wet_link adds a dynamic title attribute to txp:permlink’s capabilities.
  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: 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 includes Textpacks for English and German. For other languages, just amend the Textpack below and paste it as a Textpack on the “Preferences->Language” admin screen. :

#@admin
#@language en-gb
wet_quicklink_insert_link => Insert Link
wet_quicklink_loading => Loading…

Replace en-gb with the language code for your target language, and introduce your own wording for both “Insert Link“and “Loading…”. Leave everything else untouched.

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!
2009-03-07 wet_quicklink 0.5, wet_peex 0.4 Remove deprecated jQuery XPath selectors and change plugin type to “admin only”.
2009-10-15 wet_quicklink 0.6 Textpattern 4.2 compatibility: Multi-site awareness, make use of new core APIs.
2010-05-25 wet_quicklink 0.7 Safe link pattern as a global preference; fix PHP 4 parse error; embed Textpacks in en-gb and de-de.
2011-06-11 wet_quicklink 0.8 Requires Textpattern 4.3+; Fix Textpacks in en-gb and de-de.
2011-06-23 wet_quicklink 0.8.1 Fix CSS. Thanks, uli.
2011-07-20 wet_quicklink 0.8.2 Avoid PHP notice on sites without localized UI strings.
2012-11-21 wet_peex 1.0 Fix double escaping for article title.