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
- Textpattern 4.2+ is required, wet_quicklink will not work with any prior version.
- Install wet_quicklink.txt as a Textpattern plugin.
- Install wet_quicklink’s sidekick wet_peex.txt as a Textpattern plugin.
- 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
- Select the anchor text in the article title, body or excerpt text areas, or in any custom field.
- Click “Insert Link”.
- Locate the target article by browsing through the list. Narrow down the amount of listed articles by performing a live content search.
- Choose a markup method:
URLinserts a pure web address which is probably most useful with custom fields serving a special purpose (depends on your site’s architecture, of course).HTMLspits out plain old<a href="...">...</a>tags.Textileis technically equivalent toHTML, but a little less verbose.txp:permlinkinjects 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_linkadds a dynamic title attribute totxp:permlink’s capabilities.
- Click on the article’s title to insert the link.
- 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 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:
$textarray['wet_quicklink_insert_link'] = 'Insert Link'; $textarray['wet_quicklink_loading'] = 'Loading…';
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 |