Adding support for the link_text tag in Textpattern

Blogged into & on 01/11/2006 | comment

I’m currently working on a client site that’s running Textpattern. While working on their proverbial “links” page, for probably the first time, I needed to display the actual URL that each link points to.

So, I grabbed the <txp:link_text /> tag and put it into the Links form. Surprisingly, this resulted in an error due to the simple fact that Textpattern presently lacks support for the <txp:link_text /> tag.

Ater some brief Googling, I found a solution here, however, it was in German.

In spite of the German, the directions were fairly obvious and I managed to solve my problem.

So, to save anyone from the trouble of having to guess, I’m providing an English version of those directions here for those who would like to support for this tag in their TXP installation.

Here’s what to do…

As of Textpattern 4.0.2, open up textpattern/publish/taghandlers.php and go to line 217, and add below it the following two lines:

$out = str_replace("<txp:link_text />", doSpecial($url), $out); $out = str_replace("<txp:link_name />", $linkname, $out);

Hit save, upload, and you’re done.

For a spanish translation of this article, visit tocomocho.net.

Don't believe me? Here's what others are saying...

  • Hey, thanks. :) How rediculous…


    ikebowen    03/11/2006    #

  • Happy to help. Hey, if it’s rediculous and related to textpattern, you’ll probably find it here!


    Terry Evans    03/13/2006    #

If you are using Internet Explorer for the MAC, you'll notice this website looks a little strange. That's because we've chosen not to provide full CSS support for that browser. All content is still accessible, it's just not as pretty - but neither is your browser. For the full meal deal, we recommend upgrading your web browser.