Lalabobo.net

Present now

External Link Textpattern Plugin · 8 October 2007, 02:35 by Jean Rajotte

Yeah! My first txp plugin. I use external links all the time and have longed for a simple way to write them WITHOUT client-side Javascript dependency. I looked for this in other plugins to no avail…

Now, it’s as simple as writing the link like this:

my "(_)external":http://elsewhere.com link.

It’s a hack. With the <txp:jra_ext_link> tag wrapping the page, all links w/ class="_" get a target="_blank" added server-side.

Get the v0.2 installation text, enjoy and let me know if it helps.

And please let me know whether it could be written more efficiently… E.g., what’s the performance cost of parse($this) when this is the whole body?

 
Jean Rajotte · 8 October 2007, 06:57 · #

Answering my own question, it really doesn’t look like there’s any cost. parse() needs to happen, and keeps happening recursively and double at times, across all tags. IOW, I don’t think it’s an issue.

Jean Rajotte · 9 October 2007, 00:41 · #

However, I did experience gruesome slow downs during this development bout. Turns out is had nothing to do w/ my plugin. It had to do w/ Spam blacklists pointing to spamhaus and completely slowing down each page refresh. There’s forum discussions about that.

IMO, it is a design flaw that blacklists are checked when READING the site. They should be checked only when WRITING to the site — take the hit when posting. It’s not outrageous then, whereas it’s useless when reading. One can change the code in txp, or one can remove the list from the Admin|preferences|advanced|Spam blacklists and speed is back.

Sorry to go on off topic. The plugin is just fine. Nothing to do w/ my lost Sunday trying to trace the slowdown :-)

Angela Wangsawidjaja · 31 December 2008, 13:03 · #

Hi

This is my first time using textpattern and I was looking for this so hard on textpattern site and I finally found it… thank you for your great work…

but 1 question… why am i getting <br> tags added before and after causing the layout to be more spaced out then it’s meant to be?

this is what i add in my article

<txp:jra_ext_link class=“noline”>
» Aspen Inn & Suites
</txp:jra_ext_link>
The perfect place to begin your holiday and enjoy the many attractions Smithers has to offer. Only a 30 minute drive from Hudson Bay Mountain and terrific ski package rates.

this is what happens when it render out in html

<p><br>
<a href=“http://www.aspeninnsmithers.com/” target=”_blank” class=“noline”>» Aspen Inn &amp; Suites</a><br>

<br>
The perfect place to begin your holiday and enjoy the many attractions Smithers has to offer. Only a 30 minute drive from Hudson Bay Mountain and terrific ski package rates.</p>

How do i get rid of the 1st <br> tag after <p> and the extra 2nd <br> after the </a><br>

Please let me know if there’s a way around this? Thank you.

Jean Rajotte · 8 March 2010, 22:39 · #

@Angela. Years later, I reply — sorry for having missed your question.

The <jra_ext_link> tag should not be used in an article, but rather in the page templates. The <br>‘s are introduced by textile’s handling of inplace HTML in an article.

Put a single <jra_ext_link> tag around the whole page template and just use the trigger class in the links you define in articles, like

==”(_)my link”:http://my.link==.

j

Add a comment

Textile Help