2 yabba Aug 06, 2007 09:40

Perfect again... that solves exactly my problem! Thank you very much!
Will this work for 1.10.02 as well?
EDIT: never mind, it does, once I properly read the directions!
function b2evoInsertLink(myField, i, defaultValue) {
if (!defaultValue) {
defaultValue = 'http://';
}
if (!b2evoCheckOpenTags(i)) {
var URL = prompt('<?php echo T_('URL') ?>:' ,defaultValue);
if (URL) {
b2evoButtons[i].tagStart = '<a href="' + URL + '" target="_top">';
b2evoInsertTag(myField, i);
I'm using "Navy Pier". My file looks like the above (it already has the _top). Problem is, when I add a link and save it it does not put the target into the link and I have to go back in and manually add it. What gives?, shouldn't it be there on all my links?
-Joel
hi Joel,
Looks like this is going to work in 2.0.2. Do you have the plugin installed and active?
Good luck
it took me quite a bit of searching on the forums but this thread just made my day :D
i wonder if the b2evo team could consider making some sort of "on/off" button or setting acceseble from the backoffice for external linking.
That's great, how can you do the same for links entered in the "Link to url:" field whilst posting?
Thanks in advance.
¥åßßå wrote:
2) I add a class="ext" to all my external links, that way they can be styled differently
¥
I am interested in applying this method.
I just wondered how you go about it. Do you manually add the class to the string whilst posting or is it automatic?
I guess you make a new class in your CSS file but is there anything else you need to do? Does the post know if the link is internal or external? if so how?
Hi! I have a plugin to replace the bundled blogroll, adding xfn rel tags that can be setted to open the linkroll links on new windows. You can just add the rel="external" to your links and it will work!
Walter, I'm a little lost on this. I installed the plugin/widget, and added the "js" line to my html header file, but I don't see where to put the "rel" line.
Hi cslepage!
Well, the widget is a drop-in replacement for the linkblog. Have you added the linkblog provided by the widget?
Although, I think that I can provide a plugin for _blank and another for the linkblog.
After that, add to your links:
<a href="link" rel="external">External Link</a>
Walter wrote:
Hi cslepage!
Well, the widget is a drop-in replacement for the linkblog. Have you added the linkblog provided by the widget?
Yes, and so far, it's identical the "normal" linkblog. Thought I'm assuming that's because I'm lacking the "rel" portion.
Although, I think that I can provide a plugin for _blank and another for the linkblog.
After that, add to your links:
<a href="link" rel="external">External Link</a>
Instead of just putting "http://www....."?
Yes, identical, but a little different:
- Id the widget settings, you can configure it to don't show categories on the linkblog
- You can configure the links to open on a new window.
- You can use tags in the linkblog posts as xfn relations.
- And you can open another links on new windows :) just add rel="external" to href
You just publish your linkblog posts as you have done until today :)
and, if you want another link to open on a external window, just do:
<a href="http://b2evolution.net" rel="external">b2evolution</a>
Allright?
Okay, now I see, these are two different activities.
So, the "rel" is for links I place in a blog post? And I would have to manually add the "rel" to each link?
Well, yes, it had to be done manually :(
Except for the links on the linkblog, if you set the widget to open the linkblog links on a new windows, it works automatically.
Do you want to make this automatic for all the links on your site?
I think that I could do a plugin for that.
That would be great. To be honest, I could add "target=blank" manually to each tag if I wanted to. Though I suppose I could go back and alter the quicktags.php file like I did in my old skin.
Well, I can work on the plugin by the weekend, I think. :D
I look forward to testing it!
I will try to implement this on my plugin!
Isn't target=blank deprecated? I use onclick="window.open(this.href); return false; to validate and get the same effect
Please don't dig up 2 year old posts
¥
1) crack open plugins/quicktags.php and change this bit to add the target="_blank" ( this will add it to all links )
2) I add a class="ext" to all my external links, that way they can be styled differently
¥