Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-26 16:01:52

carachi
Member
Registered: 2005-03-12
Posts: 11

[textile] rel="external"

Hi

I would like to make external links in my text/article using Textile.
Is this possible in Textile?

If not, is there some plug-in I could use?
(I searched for it in the plug-in department, but did not find any?)

I just want to make nice valid url:s using the rel=”“ and some javascript to make links to other sites open up in a new window. I often have links to other sites in my article text, so i want them to be open exteranally, not to take the visitor away from the text flow…

Would apreciate some help on this!

Offline

#2 2007-03-26 17:27:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: [textile] rel="external"

related?

Last edited by colak (2007-09-10 14:50:12)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2007-03-26 18:46:18

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: [textile] rel="external"

Textile provides no means for attributing links. Would you consider zem_prblock? This could easily be modified to adorn links with “external” instead of “nofollow”.

Offline

#4 2007-03-26 19:10:30

carachi
Member
Registered: 2005-03-12
Posts: 11

Re: [textile] rel="external"

Yes, this looks like it could work…

But could you please give me a hint on how to edit it?

Do I just replace all “nofollow” with “external” in all places?
What about the javascript part?
(Sorry, I don’t do php… :-ı)

if ($linkdomain and @$url[‘scheme’] 'http' and $linkdomain != $mydomain) { if ($type ‘nofollow’) { $atts[‘rel’] = ‘nofollow’; } else { $atts[‘href’] = ‘javascript:;’; $atts[‘onClick’] = “window.location.href=’$link’; return false;”; }

===
I also found: <pnh_mf> – a plugin for Microformats
It seems to do kind of the same thing?
But i am not sure i could enclose a whole article with it, like <zem_prblock> ?

Offline

#5 2007-03-26 19:14:16

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: [textile] rel="external"

carachi wrote:

Do I just replace all “nofollow” with “external” in all places?

I think that’s about all. The javascript part is an alternative for those who do not want to use rel.

Last edited by wet (2007-03-26 19:14:33)

Offline

#6 2014-09-08 23:53:11

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: [textile] rel="external"

Hey – is this still the case – no support for rel=”“ in textile?

Offline

#7 2014-09-09 01:05:33

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: [textile] rel="external"

tye wrote #283576:

Hey – is this still the case – no support for rel=”“ in textile?

If you read Native textile code for manage link “rel” attributes there was a proposed standard using curly brackets {} but it seems to have never been fully implemented.

Offline

#8 2014-09-09 06:41:37

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: [textile] rel="external"

Thanks Michael – yeah I did read those articles before I posted… sometimes with all this techy coding talk I can never work out if it is included or not… I guess not though :(

Wonder why I didn’t get a notification of your reply – thought I would be automatically subscribed by being part of the thread?

Offline

#9 2014-09-09 07:42:18

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [textile] rel="external"

To complete, there is a txp solution: create your external links under “Links” tab, and output them like this:

blah <txp:linklist id="5"><txp:link rel="external" /></txp:linklist> blah

or create an “external” link form with just <txp:link rel="external" /> inside and call <txp:linklist id="5" form="external" />.

Another (inline) possibility is etc_query: create a Miscellaneous type form “external”:

<txp:etc_query data='<txp:yield />' replace="a@@rel=external" />

and output the external links like this (mind spaces):

<txp:output_form form="external"> "question":http://forum.textpattern.com/viewtopic.php?id=21828 </txp:output_form>

Not extra handy, but you can alter any attribute this way.

Edit: or let etc_query do it automatically, replacing <txp:body /> in the article form with

<txp:etc_query data='<txp:body />'
	replace='//a[starts-with(@href, "http") and not(starts-with(@href, "<txp:site_url />"))]@@rel=external@target=_blank' />

Last edited by etc (2014-09-09 08:19:52)

Offline

Board footer

Powered by FluxBB