Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#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
Re: [textile] rel="external"
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
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
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
Re: [textile] rel="external"
Hey – is this still the case – no support for rel=”“ in textile?
Offline
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
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
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
Pages: 1