Posted on: 07/17/08 10:17pm
By: Anonymous (Ronald)
I'm very impressed with GL 1.5, and even more with the new options in the LINK plugin. However there is one small detail I would like to open the selection in a new window...aka open _blank...
I did a quick search, but couldn't a quick fix to change this...
Maybe somebody can help me...
With kind regards,
Ronald
Re: Link Plugin, open in new Window
Posted on: 07/18/08 05:33am
By: beewee
Change the template of the linkitems, look for the template in plugins/links/templates/
Re: Link Plugin, open in new Window
Posted on: 07/18/08 05:38am
By: Anonymous (Ronald)
Indeed, that worked fine in GL 1.4.1, but this is GL 1.5 and linkdetails.thtml are not the same anymore...
Re: Link Plugin, open in new Window
Posted on: 07/18/08 12:28pm
By: jmucchiello
Yeah, the links plugin now uses the COM_createLink function. It takes all control away from the theme maker.
Re: Link Plugin, open in new Window
Posted on: 07/21/08 12:08pm
By: Anonymous (Ronald)
Now we know where not to look to fix it, does anybody knows how we can change the open in new window option?
Re: Link Plugin, open in new Window
Posted on: 07/21/08 02:34pm
By: jmucchiello
You need to find the call to COM_createLink in the links/index.php and add array('target' => '_new'
to the $attr parameter.
Re: Link Plugin, open in new Window
Posted on: 07/21/08 10:30pm
By: Anonymous (Ronald)
Sorry jmucchiello,
I'm not a programmer, I have some knowledge of HTML, maybe you can be more specific what I need to change.
So much thanks in advance.....
Ronald
Re: Link Plugin, open in new Window
Posted on: 07/21/08 11:04pm
By: jmucchiello
Sorry. I don't have the time to actually make a patch. Make feature request in the bug tracker. (click the "report a bug" link on the left under "support" and maybe it will get into a future release of GL.
Re: Link Plugin, open in new Window
Posted on: 07/27/08 12:21am
By: Anonymous (Ronald)
Nobody have an idea how to make the link plugin to open links in a new window?
Re: Link Plugin, open in new Window
Posted on: 07/27/08 04:04am
By: Anonymous (ironmax)
To make that link open in a new window. All you should have to do is what jmucchiello said by looking for the COM_createLink in the /public_html/links/index.php file. There are 4 COM_createLink var in the file. Find the first one at about line 359.
Text Formatted Code
$html = COM_createLink($content, $url, $attr);
Just above that, you will see this.
Text Formatted Code
$content = stripslashes ($A['title']);
$attr = array(
'title' => stripslashes ($A['url']),
'class' => 'ext-link');
$html = COM_createLink($content, $url, $attr);
$template->set_var ('link_html', $html);
You will need to change line 356 to read like this.
Text Formatted Code
$attr = array('target' => '_new',
So the entire code area looks like this after you are done.
Text Formatted Code
$content = stripslashes ($A['title']);
$attr = array('target' => '_new',
'title' => stripslashes ($A['url']),
'class' => 'ext-link');
$html = COM_createLink($content, $url, $attr);
$template->set_var ('link_html', $html);
It was tested and works. If anyone else finds a problem with it, please make the corrections here.
Michael
Re: Link Plugin, open in new Window
Posted on: 07/27/08 07:28am
By: Anonymous (Ronald)
Nice Ironmax,
You made it so simple.... And you help me sooooo much
Thanks...